Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/baidu/Familia
/ functions
Functions
145 in github.com/baidu/Familia
⨍
Functions
145
◇
Types & classes
29
↓ 46 callers
Method
size
src/vocab.cpp:20
↓ 19 callers
Method
size
返回文档中词的数量
include/familia/document.h:65
↓ 12 callers
Method
num_topics
src/semantic_matching.cpp:32
↓ 12 callers
Function
split
src/util.cpp:11
↓ 12 callers
Method
topic_sum
src/model.cpp:25
↓ 11 callers
Function
rand
返回min~max之间的随机浮点数, 默认返回0~1的浮点数
include/familia/util.h:44
↓ 10 callers
Method
infer
src/inference_engine.cpp:37
↓ 8 callers
Method
alpha
include/familia/model.h:75
↓ 7 callers
Method
beta
include/familia/model.h:83
↓ 7 callers
Method
beta_sum
include/familia/model.h:87
↓ 7 callers
Method
tokenize
分词 简易的FMM分词工具,只针对主题模型中出现的词表进行正向匹配 Args: input_text: 输入文本,编码需要跟词表编码保持一致 Returns: 返回一个list对象,其中每个元素为分
python/demo/familia_wrapper.py:47
↓ 7 callers
Method
word_topic
返回模型中某个词在某个主题下的参数值,由于模型采用稀疏存储,若找不到则返回0
include/familia/model.h:42
↓ 6 callers
Method
sparse_topic_dist
src/document.cpp:43
↓ 5 callers
Function
rand_k
返回[0, k - 1]之间的整型浮点数
include/familia/util.h:52
↓ 5 callers
Method
tokenize
src/tokenizer.cpp:15
↓ 4 callers
Method
dense_topic_dist
src/document.cpp:64
↓ 4 callers
Method
num_topics
src/demo/topic_word_demo.cpp:57
↓ 4 callers
Method
set_topic
src/document.cpp:31
↓ 3 callers
Method
contains_word
src/semantic_matching.cpp:28
↓ 3 callers
Function
print_result
(result_list)
python/demo/topic_word_demo.py:15
↓ 3 callers
Method
term_id
include/familia/model.h:34
↓ 2 callers
Method
accumulate_topic_sum
src/document.cpp:77
↓ 2 callers
Method
alpha_sum
include/familia/model.h:79
↓ 2 callers
Function
fix_random_seed
固定随机种子并重置分布
include/familia/util.h:36
↓ 2 callers
Method
generate
src/vose_alias.cpp:62
↓ 2 callers
Method
get_model
返回模型指针以便获取模型参数
include/familia/inference_engine.h:53
↓ 2 callers
Method
init
-------------LDA Begin---------------
src/document.cpp:16
↓ 2 callers
Method
initialize
src/vose_alias.cpp:14
↓ 2 callers
Function
load_prototxt
include/familia/util.h:57
↓ 2 callers
Method
model_type
返回模型类型, 指明为LDA还是SetennceLDA
include/familia/inference_engine.h:58
↓ 2 callers
Method
nearest_words
寻求与目标词最相关的词 对模型中的所有词语(不包哈目标词)进行检索,通过计算cosine相似度,返回最相关的k个词语 Args: word: 目标词 k: 设置返回最邻近词的个数,默认为10个 Retur
python/demo/familia_wrapper.py:164
↓ 2 callers
Method
nearest_words_around_topic
寻求与目标主题最相关的词 对模型中的所有词语进行检索,通过计算cosine相似度,返回最相关的k个词语 Args: topic_id: 目标主题ID k: 设置返回最邻近词的个数,默认为10个 Retur
python/demo/familia_wrapper.py:181
↓ 2 callers
Function
print_doc_topic_dist
打印文档的主题分布
src/demo/inference_demo.cpp:25
↓ 2 callers
Method
sample_doc
src/sampler.cpp:11
↓ 2 callers
Method
set_alpha
配置文档先验参数alpha
include/familia/document.h:60
↓ 2 callers
Method
type
include/familia/model.h:91
↓ 1 callers
Method
add_sentence
src/document.cpp:93
↓ 1 callers
Method
add_token
src/document.cpp:24
↓ 1 callers
Method
cal_doc_distance
计算长文本与长文本之间的距离 计算两个长文本的主题分布之间的距离,包括jensen_shannon_divergence和hellinger_distance Args: doc1: 输入文档1,无需分词 doc2:
python/demo/familia_wrapper.py:101
↓ 1 callers
Method
cal_doc_distance
计算长文本之间的相似度 可选的指标包括常用的分布间距离Jensen-Shannon Diveregnce和Hellinger Distance
src/demo/doc_distance_demo.cpp:38
↓ 1 callers
Method
cal_query_doc_similarity
计算短文本与长文本之间的相关性 使用LDA模型和TWE模型分别衡量短文本跟长文本之间的相关性 Args: query: 输入短文本,无需分词 doc: 输入长文本,无需分词 Returns:
python/demo/familia_wrapper.py:120
↓ 1 callers
Method
cal_query_doc_similarity
计算query (短文本) 与 document (长文本) 的相似度 可选的指标包括: 1. document主题分布生成query的likelihood, 值越大相似度越高 2. 基于TWE模型的相似度计算
src/demo/query_doc_sim_demo.cpp:42
↓ 1 callers
Method
find_nearest_words
获取词距离最近的k个词,并打印出来
src/demo/word_distance_demo.cpp:33
↓ 1 callers
Method
get_id
src/vocab.cpp:15
↓ 1 callers
Function
lda_infer
使用LDA模型对输入的分词文本进行infer
python/cpp/familia_wrapper.cpp:161
↓ 1 callers
Method
lda_infer
LDA模型推断 使用LDA模型对输入文本进行推断,得到其主题分布 Args: words: 分词后的list结果 Returns: 返回一个list对象,存放输入文本对应的稀疏主题分布,list中每
python/demo/familia_wrapper.py:60
↓ 1 callers
Method
load
src/vocab.cpp:24
↓ 1 callers
Function
load_item_topic_table
加载模型信息
src/demo/show_topic_demo.cpp:66
↓ 1 callers
Function
load_vocabulary
加载词典信息
src/demo/show_topic_demo.cpp:45
↓ 1 callers
Method
nearest_words
src/semantic_matching.cpp:78
↓ 1 callers
Method
nearest_words_around_topic
src/semantic_matching.cpp:100
↓ 1 callers
Function
print_result
(result_list)
python/demo/word_distance_demo.py:15
↓ 1 callers
Method
show_topics
打印指定主题下的前k个词
src/demo/show_topic_demo.cpp:114
↓ 1 callers
Method
show_topics
展示同个主题下不同召回方式的结果
src/demo/topic_word_demo.cpp:39
↓ 1 callers
Function
slda_infer
使用SentenceLDA模型对输入的分词文本进行infer
python/cpp/familia_wrapper.cpp:193
↓ 1 callers
Method
slda_infer
SentenceLDA模型推断 使用SentenceLDA模型对输入文本进行推断,得到其主题分布 Args: sentences: 其中每个元素为一个list对象,存放一个句子 例如: [[A
python/demo/familia_wrapper.py:77
↓ 1 callers
Method
topic_sum
include/familia/document.h:69
↓ 1 callers
Method
vocab_size
include/familia/model.h:71
Method
DocDistanceDemo
src/demo/doc_distance_demo.cpp:29
Method
GibbsSampler
include/familia/sampler.h:110
Method
InferenceEngine
src/inference_engine.cpp:16
Method
LDADoc
include/familia/document.h:40
Method
MHSampler
include/familia/sampler.h:36
Function
PyInit_familia
python/cpp/familia_wrapper.cpp:431
Method
QueryDocSimDemo
src/demo/query_doc_sim_demo.cpp:30
Method
SLDADoc
include/familia/document.h:102
Method
ShowTopicDemo
src/demo/show_topic_demo.cpp:97
Method
SimpleTokenizer
include/familia/tokenizer.h:33
Method
Tokenizer
include/familia/tokenizer.h:22
Method
TopicModel
src/model.cpp:13
Method
TopicModel
include/familia/model.h:30
Method
TopicWordDemo
src/demo/topic_word_demo.cpp:31
Method
TopicalWordEmbedding
include/familia/semantic_matching.h:35
Method
Vocab
include/familia/vocab.h:22
Method
VoseAlias
include/familia/vose_alias.h:19
Method
WordCount
src/demo/show_topic_demo.cpp:35
Method
WordDistanceDemo
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
Function
cal_doc_distance
计算长文本与长文本之间的距离
python/cpp/familia_wrapper.cpp:232
Function
cal_query_doc_similarity
计算短文本与长文本之间的相似度
python/cpp/familia_wrapper.cpp:280
Method
construct_alias_table
src/sampler.cpp:200
Method
contains
src/tokenizer.cpp:55
Method
cosine_similarity
计算两个embedding的余弦相似度
include/familia/semantic_matching.h:94
Function
destroy_inference_engine
销毁InferenceEngine对象
python/cpp/familia_wrapper.cpp:60
Function
destroy_tokenizer
销毁Tokenizer对象
python/cpp/familia_wrapper.cpp:92
Function
destroy_twe
销毁Topical Word Embeddings对象
python/cpp/familia_wrapper.cpp:122
Method
doc_proposal
src/sampler.cpp:61
Method
doc_proposal_distribution
src/sampler.cpp:189
Method
engine_wrapper_t
include/familia/util.h:25
Method
hellinger_distance
Hellinger Distance REQUIRE: 传入的两个参数维度须一致
include/familia/semantic_matching.h:202
Function
init_inference_engine
创建InferenceEngine对象
python/cpp/familia_wrapper.cpp:33
Function
init_tokenizer
创建Tokenizer对象用来分词
python/cpp/familia_wrapper.cpp:75
Function
init_twe
创建Topical Word Embeddings对象
python/cpp/familia_wrapper.cpp:105
Function
initfamilia
模块初始化
python/cpp/familia_wrapper.cpp:437
Method
is_eng_char
检查字符是否为英文字符
include/familia/tokenizer.h:49
Method
jensen_shannon_divergence
Jensen-Shannon Divergence REQUIRE: 传入的两个参数维度须一致
include/familia/semantic_matching.h:181
Method
kullback_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