All Projects → baidu → Familia

baidu / Familia

Licence: bsd-3-clause
A Toolkit for Industrial Topic Modeling

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
Makefile
30231 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to Familia

PyLDA
A Latent Dirichlet Allocation implementation in Python.
Stars: ✭ 51 (-97.96%)
Mutual labels:  topic-modeling, lda, topic-models
amazon-reviews
Sentiment Analysis & Topic Modeling with Amazon Reviews
Stars: ✭ 26 (-98.96%)
Mutual labels:  topic-modeling, lda
hlda
Gibbs sampler for the Hierarchical Latent Dirichlet Allocation topic model
Stars: ✭ 138 (-94.48%)
Mutual labels:  topic-modeling, lda
NMFADMM
A sparsity aware implementation of "Alternating Direction Method of Multipliers for Non-Negative Matrix Factorization with the Beta-Divergence" (ICASSP 2014).
Stars: ✭ 39 (-98.44%)
Mutual labels:  topic-modeling, lda
TopicsExplorer
Explore your own text collection with a topic model – without prior knowledge.
Stars: ✭ 53 (-97.88%)
Mutual labels:  topic-modeling, lda
tomoto-ruby
High performance topic modeling for Ruby
Stars: ✭ 49 (-98.04%)
Mutual labels:  topic-modeling, lda
KGE-LDA
Knowledge Graph Embedding LDA. AAAI 2017
Stars: ✭ 35 (-98.6%)
Mutual labels:  topic-modeling, lda
Lda
LDA topic modeling for node.js
Stars: ✭ 262 (-89.52%)
Mutual labels:  topic-modeling, lda
pydataberlin-2017
Repo for my talk at the PyData Berlin 2017 conference
Stars: ✭ 63 (-97.48%)
Mutual labels:  topic-modeling, lda
kwx
BERT, LDA, and TFIDF based keyword extraction in Python
Stars: ✭ 33 (-98.68%)
Mutual labels:  topic-modeling, lda
Topic-Modeling-Workshop-with-R
A workshop on analyzing topic modeling (LDA, CTM, STM) using R
Stars: ✭ 51 (-97.96%)
Mutual labels:  topic-modeling, lda
Sttm
Short Text Topic Modeling, JAVA
Stars: ✭ 100 (-96%)
Mutual labels:  topic-modeling, lda
Ldagibbssampling
Open Source Package for Gibbs Sampling of LDA
Stars: ✭ 218 (-91.28%)
Mutual labels:  topic-modeling, lda
lda2vec
Mixing Dirichlet Topic Models and Word Embeddings to Make lda2vec from this paper https://arxiv.org/abs/1605.02019
Stars: ✭ 27 (-98.92%)
Mutual labels:  topic-modeling, lda
topic models
implemented : lsa, plsa, lda
Stars: ✭ 80 (-96.8%)
Mutual labels:  topic-modeling, topic-models
Lightlda
fast sampling algorithm based on CGS
Stars: ✭ 49 (-98.04%)
Mutual labels:  topic-modeling, lda
Lda Topic Modeling
A PureScript, browser-based implementation of LDA topic modeling.
Stars: ✭ 91 (-96.36%)
Mutual labels:  topic-modeling, lda
Nlp Journey
Documents, papers and codes related to Natural Language Processing, including Topic Model, Word Embedding, Named Entity Recognition, Text Classificatin, Text Generation, Text Similarity, Machine Translation),etc. All codes are implemented intensorflow 2.0.
Stars: ✭ 1,290 (-48.38%)
Mutual labels:  lda
Hypertools
A Python toolbox for gaining geometric insights into high-dimensional data
Stars: ✭ 1,678 (-32.85%)
Mutual labels:  topic-modeling
Topic Modeling Tool
A point-and-click tool for creating and analyzing topic models produced by MALLET.
Stars: ✭ 85 (-96.6%)
Mutual labels:  topic-modeling
logo

Build Status License

Familia 开源项目包含文档主题推断工具、语义匹配计算工具以及基于工业级语料训练的三种主题模型:Latent Dirichlet Allocation(LDA)、SentenceLDA 和Topical Word Embedding(TWE)。 支持用户以“拿来即用”的方式进行文本分类、文本聚类、个性化推荐等多种场景的调研和应用。考虑到主题模型训练成本较高以及开源主题模型资源有限的现状,我们会陆续开放基于工业级语料训练的多个垂直领域的主题模型,以及这些模型在工业界的典型应用方式,助力主题模型技术的科研和落地。(English)

News!!!

近期,我们在PaddleHub 1.8版本中上线了Familia中的LDA模型,根据数据集的不同,区分为lda_news、lda_novel和lda_webpage。

PaddleHub使用起来非常便捷,我们以lda_news的使用来进行例子介绍。

  1. 首先,在使用PaddleHub之前,需要先安装PaddlePaddle深度学习框架,更多安装说明请查阅飞桨快速安装

  2. 安装Paddlehub: pip install paddlehub

  3. lda_news模型安装:hub install lda_news

  4. 具体使用:

import paddlehub as hub

lda_news = hub.Module(name="lda_news")
jsd, hd = lda_news.cal_doc_distance(doc_text1="今天的天气如何,适合出去游玩吗", doc_text2="感觉今天的天气不错,可以出去玩一玩了")
# jsd = 0.003109, hd = 0.0573171

lda_sim = lda_news.cal_query_doc_similarity(query='百度搜索引擎', document='百度是全球最大的中文搜索引擎、致力于让网民更便捷地获取信息,找到所求。百度超过千亿的中文网页数据库,可以瞬间找到相关的搜索结果。')
# LDA similarity = 0.06826

results = lda_news.cal_doc_keywords_similarity('百度是全球最大的中文搜索引擎、致力于让网民更便捷地获取信息,找到所求。百度超过千亿的中文网页数据库,可以瞬间找到相关的搜索结果。')
# [{'word': '百度', 'similarity': 0.12943492762349573}, 
#  {'word': '信息', 'similarity': 0.06139783578769882}, 
#  {'word': '找到', 'similarity': 0.055296603463188265}, 
#  {'word': '搜索', 'similarity': 0.04270794098349327}, 
#  {'word': '全球', 'similarity': 0.03773627056367886}, 
#  {'word': '超过', 'similarity': 0.03478658388202199}, 
#  {'word': '相关', 'similarity': 0.026295857219683725}, 
#  {'word': '获取', 'similarity': 0.021313585287833996}, 
#  {'word': '中文', 'similarity': 0.020187103312009513}, 
#  {'word': '搜索引擎', 'similarity': 0.007092890537169911}]

更加具体的介绍和使用方法可以看这里:https://www.paddlepaddle.org.cn/hublist?filter=en_category&value=SemanticModel

应用介绍

Familia目前包含的主题模型的对应论文介绍可以参考相关论文

主题模型在工业界的应用范式可以抽象为两大类: 语义表示和语义匹配。

  • 语义表示 (Semantic Representation)    对文档进行主题降维,获得文档的语义表示,这些语义表示可以应用于文本分类、文本内容分析、CTR预估等下游应用。

  • 语义匹配 (Semantic Matching)

    计算文本间的语义匹配度,我们提供两种文本类型的相似度计算方式:

    • 短文本-长文本相似度计算,使用场景包括文档关键词抽取、计算搜索引擎查询和网页的相似度等等。
    • 长文本-长文本相似度计算,使用场景包括计算两篇文档的相似度、计算用户画像和新闻的相似度等等。

更详细的内容及工业界应用案例可以参考Familia Wiki , 如果想要对上述应用范式进行基于Web的可视化展示,可以参考Familia-Visualization

代码编译

第三方依赖包括gflags-2.0glogs-0.3.4protobuf-2.5.0, 同时要求编译器支持C++11, g++ >= 4.8, 兼容Linux和Mac操作系统。 默认情况下执行以下脚本会自动获取依赖并安装。

$ sh build.sh # 包含获取并安装第三方依赖的过程

模型下载

$ cd model
$ sh download_model.sh

我们会陆续开放不同领域的多种主题模型,来满足更多不同的场景需求。

Demo

Familia自带的Demo包含以下功能:

  • 语义表示计算 利用主题模型对输入文档进行主题推断,以得到文档的主题降维表示。

  • 语义匹配计算   计算文本之间的相似度,包括短文本-长文本、长文本-长文本间的相似度计算。

  • 模型内容展现    对模型的主题词,近邻词进行展现,方便用户对模型的主题有直观的理解。

具体的Demo使用说明可以参考使用文档

注意事项

  • 若出现找不到libglog.so, libgflags.so等动态库错误,请添加third_party至环境变量的LD_LIBRARY_PATH中。

    export LD_LIBRARY_PATH=./third_party/lib:$LD_LIBRARY_PATH

  • 代码中内置简易的FMM分词工具,只针对主题模型中出现的词表进行正向匹配。若对分词和语义准确度有更高要求,建议使用商用分词工具,并使用自定义词表的功能导入主题模型中的词表。

问题咨询

欢迎提交任何问题和Bug Report至Github Issues。 或者发送咨询邮件至{ familia } at baidu.com

Docker

docker run -d \
    --name familia \
    -e MODEL_NAME=news \
    -p 5000:5000 \
    orctom/familia

MODEL_NAME can be one of news/novel/webpage/webo

API

http://localhost:5000/swagger/

Citation

The following article describes the Familia project and industrial cases powered by topic modeling. It bundles and translates the Chinese documentation of the website. We recommend citing this article as default.

Di Jiang, Yuanfeng Song, Rongzhong Lian, Siqi Bao, Jinhua Peng, Huang He, Hua Wu. 2018. Familia: A Configurable Topic Modeling Framework for Industrial Text Engineering. arXiv preprint arXiv:1808.03733.

@article{jiang2018familia,
  author = {Di Jiang and Yuanfeng Song and Rongzhong Lian and Siqi Bao and Jinhua Peng and Huang He and Hua Wu},
  title = {{Familia: A Configurable Topic Modeling Framework for Industrial Text Engineering}},
  journal = {arXiv preprint arXiv:1808.03733},
  year = {2018}
}

Further Reading: Federated Topic Modeling

Copyright and License

Familia is provided under the BSD-3-Clause License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].