Documentation ¶
Index ¶
- Constants
- func CalCosineSimilarityOfVectors(f1, f2 []float32) float64
- func CleanChineseSentence(sentA string) string
- func CleanEnglish(sentA string) string
- func DownloadPagePostOnlyBaiduNLP(urlA string, tokenA string, ifCustomA bool, postDataA string, ...) string
- func EnsureValidEnglishOnly(textA string, ifOtherEmptyA bool) string
- func GetArticleDifficultyEnOL(strA string) (string, error)
- func GetNamedEntityEnOL(strA string) ([]string, error)
- func GetVectorCnBaiduOL(textA string, tokenA string, clientIdA string, clientSecretA string) (rs string, err string, token string)
- func NerCnBaiduOL(textA string, ifCustomA bool, tokenA string, clientIdA string, ...) (rs string, err string, token string)
- func ParseSentenceEnOL(strA string) (string, error)
- func SentimentCnBaiduOL(textA string, tokenA string, clientIdA string, clientSecretA string) (result map[string]float64, err string, token string)
- func SplitArticleCn(strA string) []string
- func SplitArticleEn(strA string) []string
- func SplitArticleEnOL(strA string) ([]string, error)
- func TagEnOL(strA string) ([]string, error)
- func TokenizeCnBaiduOL(textA string, ifCustomA bool, tokenA string, clientIdA string, ...) (rs string, err string, token string)
- func TokenizeEn(strA string) []string
- func TokenizeEnOL(strA string) ([]string, error)
- type D2VModel
- func LoadD2VModel(fileNameA string) (resultR *D2VModel, errR error)
- func LoadD2VModelWithDicts(fileNameA string, dictA string, userDictA string) (resultR *D2VModel, errR error)
- func NewD2VModel(dimA int, roundA int) (resultR *D2VModel, errR error)
- func NewD2VModelFromDicts(dimA int, roundA int, dictA string, userDictA string) (resultR *D2VModel, errR error)
- func NewD2VModelFromSegmenter(dimA int, roundA int, segmenterA *posseg.Segmenter) (*D2VModel, error)
- func TrainDoc2VecModel(dirA string, patternA string, dataFileA string, modelFileNameA string, ...) (*D2VModel, error)
- func (p *D2VModel) Dim() int
- func (p *D2VModel) GetDocVector(strA string) ([]float32, error)
- func (p *D2VModel) GetDocVectorMust(strA string) []float32
- func (p *D2VModel) GetSimilarityOfDocs(doc1 string, doc2 string) float64
- func (p *D2VModel) GetSimilarityOfDocsEx(doc1 string, doc2 string) float64
- func (p *D2VModel) LoadModel(fileNameA string) error
- func (p *D2VModel) Model() *doc2vec.IDoc2Vec
- func (p *D2VModel) PrepareTrainText(textA string) (resultR string)
- func (p *D2VModel) Round() int
- func (p *D2VModel) SaveModel(fileNameA string) error
- func (p *D2VModel) SetSegmenter(segmenterA *posseg.Segmenter) error
- func (p *D2VModel) SetSegmenterByDicts(dictA string, userDictA string) error
- func (p *D2VModel) TrainModel(dirA string, patternA string, dataFileA string, modelFileNameA string) error
- func (p *D2VModel) TrainModelFromString(strA string) (result error)
- type PosTaggerCn
- type TokenizerCn
- type TreebankWordTokenizer
Constants ¶
View Source
const XiaoXianDefaultTid = "tc040626"
View Source
const XiaoXianHost = "topget.org:7482"
Variables ¶
This section is empty.
Functions ¶
func CleanChineseSentence ¶
func CleanEnglish ¶
func EnsureValidEnglishOnly ¶
func GetNamedEntityEnOL ¶
func GetVectorCnBaiduOL ¶
func NerCnBaiduOL ¶
func ParseSentenceEnOL ¶
func SentimentCnBaiduOL ¶
func SplitArticleCn ¶
func SplitArticleEnOL ¶
func TokenizeCnBaiduOL ¶
func TokenizeEn ¶
func TokenizeEnOL ¶
Types ¶
type D2VModel ¶
type D2VModel struct {
// contains filtered or unexported fields
}
func LoadD2VModel ¶
func LoadD2VModelWithDicts ¶
func NewD2VModelFromDicts ¶
func TrainDoc2VecModel ¶
func (*D2VModel) GetDocVectorMust ¶
func (*D2VModel) GetSimilarityOfDocs ¶
func (*D2VModel) GetSimilarityOfDocsEx ¶
func (*D2VModel) PrepareTrainText ¶
func (*D2VModel) SetSegmenterByDicts ¶
func (*D2VModel) TrainModel ¶
func (*D2VModel) TrainModelFromString ¶
type PosTaggerCn ¶
type PosTaggerCn struct {
// contains filtered or unexported fields
}
func NewPosTaggerCn ¶
func NewPosTaggerCn(dictA string, userDictA string) (*PosTaggerCn, error)
func (*PosTaggerCn) LoadDict ¶
func (p *PosTaggerCn) LoadDict(dictA string) error
func (*PosTaggerCn) LoadUserDict ¶
func (p *PosTaggerCn) LoadUserDict(userDictA string) error
type TokenizerCn ¶
type TokenizerCn struct {
// contains filtered or unexported fields
}
func NewTokenizerCn ¶
func NewTokenizerCn(dictA string, userDictA string) (*TokenizerCn, error)
func (*TokenizerCn) LoadDict ¶
func (p *TokenizerCn) LoadDict(dictA string) error
func (*TokenizerCn) LoadUserDict ¶
func (p *TokenizerCn) LoadUserDict(userDictA string) error
type TreebankWordTokenizer ¶
type TreebankWordTokenizer struct {
// contains filtered or unexported fields
}
a modified version of treebank tokenizer start
func NewTreebankWordTokenizer ¶
func NewTreebankWordTokenizer() *TreebankWordTokenizer
func (*TreebankWordTokenizer) Tokenize ¶
func (t *TreebankWordTokenizer) Tokenize(text string) []string
func (*TreebankWordTokenizer) TokenizeWithDetail ¶
func (t *TreebankWordTokenizer) TokenizeWithDetail(text string) []string
Click to show internal directories.
Click to hide internal directories.