MCPcopy Create free account

hub / github.com/baidu/Familia / functions

Functions145 in github.com/baidu/Familia

↓ 46 callersMethodsize
src/vocab.cpp:20
↓ 19 callersMethodsize
返回文档中词的数量
include/familia/document.h:65
↓ 12 callersMethodnum_topics
src/semantic_matching.cpp:32
↓ 12 callersFunctionsplit
src/util.cpp:11
↓ 12 callersMethodtopic_sum
src/model.cpp:25
↓ 11 callersFunctionrand
返回min~max之间的随机浮点数, 默认返回0~1的浮点数
include/familia/util.h:44
↓ 10 callersMethodinfer
src/inference_engine.cpp:37
↓ 8 callersMethodalpha
include/familia/model.h:75
↓ 7 callersMethodbeta
include/familia/model.h:83
↓ 7 callersMethodbeta_sum
include/familia/model.h:87
↓ 7 callersMethodtokenize
分词 简易的FMM分词工具,只针对主题模型中出现的词表进行正向匹配 Args: input_text: 输入文本,编码需要跟词表编码保持一致 Returns: 返回一个list对象,其中每个元素为分
python/demo/familia_wrapper.py:47
↓ 7 callersMethodword_topic
返回模型中某个词在某个主题下的参数值,由于模型采用稀疏存储,若找不到则返回0
include/familia/model.h:42
↓ 6 callersMethodsparse_topic_dist
src/document.cpp:43
↓ 5 callersFunctionrand_k
返回[0, k - 1]之间的整型浮点数
include/familia/util.h:52
↓ 5 callersMethodtokenize
src/tokenizer.cpp:15
↓ 4 callersMethoddense_topic_dist
src/document.cpp:64
↓ 4 callersMethodnum_topics
src/demo/topic_word_demo.cpp:57
↓ 4 callersMethodset_topic
src/document.cpp:31
↓ 3 callersMethodcontains_word
src/semantic_matching.cpp:28
↓ 3 callersFunctionprint_result
(result_list)
python/demo/topic_word_demo.py:15
↓ 3 callersMethodterm_id
include/familia/model.h:34
↓ 2 callersMethodaccumulate_topic_sum
src/document.cpp:77
↓ 2 callersMethodalpha_sum
include/familia/model.h:79
↓ 2 callersFunctionfix_random_seed
固定随机种子并重置分布
include/familia/util.h:36
↓ 2 callersMethodgenerate
src/vose_alias.cpp:62
↓ 2 callersMethodget_model
返回模型指针以便获取模型参数
include/familia/inference_engine.h:53
↓ 2 callersMethodinit
-------------LDA Begin---------------
src/document.cpp:16
↓ 2 callersMethodinitialize
src/vose_alias.cpp:14
↓ 2 callersFunctionload_prototxt
include/familia/util.h:57
↓ 2 callersMethodmodel_type
返回模型类型, 指明为LDA还是SetennceLDA
include/familia/inference_engine.h:58
↓ 2 callersMethodnearest_words
寻求与目标词最相关的词 对模型中的所有词语(不包哈目标词)进行检索,通过计算cosine相似度,返回最相关的k个词语 Args: word: 目标词 k: 设置返回最邻近词的个数,默认为10个 Retur
python/demo/familia_wrapper.py:164
↓ 2 callersMethodnearest_words_around_topic
寻求与目标主题最相关的词 对模型中的所有词语进行检索,通过计算cosine相似度,返回最相关的k个词语 Args: topic_id: 目标主题ID k: 设置返回最邻近词的个数,默认为10个 Retur
python/demo/familia_wrapper.py:181
↓ 2 callersFunctionprint_doc_topic_dist
打印文档的主题分布
src/demo/inference_demo.cpp:25
↓ 2 callersMethodsample_doc
src/sampler.cpp:11
↓ 2 callersMethodset_alpha
配置文档先验参数alpha
include/familia/document.h:60
↓ 2 callersMethodtype
include/familia/model.h:91
↓ 1 callersMethodadd_sentence
src/document.cpp:93
↓ 1 callersMethodadd_token
src/document.cpp:24
↓ 1 callersMethodcal_doc_distance
计算长文本与长文本之间的距离 计算两个长文本的主题分布之间的距离,包括jensen_shannon_divergence和hellinger_distance Args: doc1: 输入文档1,无需分词 doc2:
python/demo/familia_wrapper.py:101
↓ 1 callersMethodcal_doc_distance
计算长文本之间的相似度 可选的指标包括常用的分布间距离Jensen-Shannon Diveregnce和Hellinger Distance
src/demo/doc_distance_demo.cpp:38
↓ 1 callersMethodcal_query_doc_similarity
计算短文本与长文本之间的相关性 使用LDA模型和TWE模型分别衡量短文本跟长文本之间的相关性 Args: query: 输入短文本,无需分词 doc: 输入长文本,无需分词 Returns:
python/demo/familia_wrapper.py:120
↓ 1 callersMethodcal_query_doc_similarity
计算query (短文本) 与 document (长文本) 的相似度 可选的指标包括: 1. document主题分布生成query的likelihood, 值越大相似度越高 2. 基于TWE模型的相似度计算
src/demo/query_doc_sim_demo.cpp:42
↓ 1 callersMethodfind_nearest_words
获取词距离最近的k个词,并打印出来
src/demo/word_distance_demo.cpp:33
↓ 1 callersMethodget_id
src/vocab.cpp:15
↓ 1 callersFunctionlda_infer
使用LDA模型对输入的分词文本进行infer
python/cpp/familia_wrapper.cpp:161
↓ 1 callersMethodlda_infer
LDA模型推断 使用LDA模型对输入文本进行推断,得到其主题分布 Args: words: 分词后的list结果 Returns: 返回一个list对象,存放输入文本对应的稀疏主题分布,list中每
python/demo/familia_wrapper.py:60
↓ 1 callersMethodload
src/vocab.cpp:24
↓ 1 callersFunctionload_item_topic_table
加载模型信息
src/demo/show_topic_demo.cpp:66
↓ 1 callersFunctionload_vocabulary
加载词典信息
src/demo/show_topic_demo.cpp:45
↓ 1 callersMethodnearest_words
src/semantic_matching.cpp:78
↓ 1 callersMethodnearest_words_around_topic
src/semantic_matching.cpp:100
↓ 1 callersFunctionprint_result
(result_list)
python/demo/word_distance_demo.py:15
↓ 1 callersMethodshow_topics
打印指定主题下的前k个词
src/demo/show_topic_demo.cpp:114
↓ 1 callersMethodshow_topics
展示同个主题下不同召回方式的结果
src/demo/topic_word_demo.cpp:39
↓ 1 callersFunctionslda_infer
使用SentenceLDA模型对输入的分词文本进行infer
python/cpp/familia_wrapper.cpp:193
↓ 1 callersMethodslda_infer
SentenceLDA模型推断 使用SentenceLDA模型对输入文本进行推断,得到其主题分布 Args: sentences: 其中每个元素为一个list对象,存放一个句子 例如: [[A
python/demo/familia_wrapper.py:77
↓ 1 callersMethodtopic_sum
include/familia/document.h:69
↓ 1 callersMethodvocab_size
include/familia/model.h:71
MethodDocDistanceDemo
src/demo/doc_distance_demo.cpp:29
MethodGibbsSampler
include/familia/sampler.h:110
MethodInferenceEngine
src/inference_engine.cpp:16
MethodLDADoc
include/familia/document.h:40
MethodMHSampler
include/familia/sampler.h:36
FunctionPyInit_familia
python/cpp/familia_wrapper.cpp:431
MethodQueryDocSimDemo
src/demo/query_doc_sim_demo.cpp:30
MethodSLDADoc
include/familia/document.h:102
MethodShowTopicDemo
src/demo/show_topic_demo.cpp:97
MethodSimpleTokenizer
include/familia/tokenizer.h:33
MethodTokenizer
include/familia/tokenizer.h:22
MethodTopicModel
src/model.cpp:13
MethodTopicModel
include/familia/model.h:30
MethodTopicWordDemo
src/demo/topic_word_demo.cpp:31
MethodTopicalWordEmbedding
include/familia/semantic_matching.h:35
MethodVocab
include/familia/vocab.h:22
MethodVoseAlias
include/familia/vose_alias.h:19
MethodWordCount
src/demo/show_topic_demo.cpp:35
MethodWordDistanceDemo
src/demo/word_distance_demo.cpp:27
Method__del__
销毁各个对象指针
python/demo/familia_wrapper.py:40
Method__del__
销毁TWE对象
python/demo/familia_wrapper.py:159
Method__init__
初始化InferenceEngine,Tokenizer,TopicalWordEmbeddings对象指针 Args: model_dir: 模型目录 conf_file: 模型配置文件 e
python/demo/familia_wrapper.py:24
Method__init__
初始化TWE对象 Args: model_dir: 模型目录路径 emb_file: topical word embeddings模型文件
python/demo/familia_wrapper.py:151
Functioncal_doc_distance
计算长文本与长文本之间的距离
python/cpp/familia_wrapper.cpp:232
Functioncal_query_doc_similarity
计算短文本与长文本之间的相似度
python/cpp/familia_wrapper.cpp:280
Methodconstruct_alias_table
src/sampler.cpp:200
Methodcontains
src/tokenizer.cpp:55
Methodcosine_similarity
计算两个embedding的余弦相似度
include/familia/semantic_matching.h:94
Functiondestroy_inference_engine
销毁InferenceEngine对象
python/cpp/familia_wrapper.cpp:60
Functiondestroy_tokenizer
销毁Tokenizer对象
python/cpp/familia_wrapper.cpp:92
Functiondestroy_twe
销毁Topical Word Embeddings对象
python/cpp/familia_wrapper.cpp:122
Methoddoc_proposal
src/sampler.cpp:61
Methoddoc_proposal_distribution
src/sampler.cpp:189
Methodengine_wrapper_t
include/familia/util.h:25
Methodhellinger_distance
Hellinger Distance REQUIRE: 传入的两个参数维度须一致
include/familia/semantic_matching.h:202
Functioninit_inference_engine
创建InferenceEngine对象
python/cpp/familia_wrapper.cpp:33
Functioninit_tokenizer
创建Tokenizer对象用来分词
python/cpp/familia_wrapper.cpp:75
Functioninit_twe
创建Topical Word Embeddings对象
python/cpp/familia_wrapper.cpp:105
Functioninitfamilia
模块初始化
python/cpp/familia_wrapper.cpp:437
Methodis_eng_char
检查字符是否为英文字符
include/familia/tokenizer.h:49
Methodjensen_shannon_divergence
Jensen-Shannon Divergence REQUIRE: 传入的两个参数维度须一致
include/familia/semantic_matching.h:181
Methodkullback_leibler_divergence
Kullback Leibler Divergence D(P||Q) = \sum_i {P(i) ln \frac {P(i)}{Q(i)} REQUIRE: 传入的两个参数维度须一致
include/familia/semantic_matching.h:168
next →1–100 of 145, ranked by callers