python - 实现 LDA 的替代形式

标签 python r nlp text-mining lda

我正在对来自六个不同来源的新闻数据语料库使用 Latent Dirichlet Allocation。我对主题的演变、出现感兴趣,并且想比较不同时间来源之间的相同点和不同点。我知道有许多改进的 LDA 算法,例如 Author-Topic 模型、Topics Over Time 等。

我的问题是,这些替代模型规范中很少有以任何标准格式实现的。一些在 Java 中可用,但大多数仅作为 session 论文存在。自己实现其中一些算法的最佳方法是什么?我相当精通 R 和 jags,并且在足够长的时间里可以在 Python 中跌跌撞撞。我愿意写代码,但我真的不知道从哪里开始,我不知道 C 或 Java。我可以仅使用手稿中的公式在 JAGS 或 Python 中构建模型吗?如果是这样,有人可以指出我这样做的例子吗?谢谢。

最佳答案

下面是我 friend 的回复,语言不通请见谅

First I wrote up a Python implementation of the collapsed Gibbs sampler seen here (http://www.pnas.org/content/101/suppl.1/5228.full.pdf+html) and fleshed out here (http://cxwangyi.files.wordpress.com/2012/01/llt.pdf). This was slow as balls.

Then I used a Python wrapping of a C implementation of this paper (http://books.nips.cc/papers/files/nips19/NIPS2006_0511.pdf). Which is fast as f*ck, but the results are not as great as one would see with NMF.

But NMF implementations I've seen, with scitkits, and even with the scipy sparse-compatible recently released NIMFA library, they all blow the f*ck up on any sizable corpus. My new white whale is a sliced, distributed implementation of the thing. This'll be non-trivial.

关于python - 实现 LDA 的替代形式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10112500/

相关文章:

python - 查询多对多字段

python - python中的Mapper和Reducer函数

Python "in"和 "=="混淆

python - python 中 print ('text' +str(variable)) 和 print ('stuff' , variable) 有什么区别?

R 循环 : Adding a column to a table if does not already exist

根据 R 中的条件删除数据框列

r - roxygen2手动插入换行符

python - 如何检查经过训练的词汇和 TfidfVectorizer 是否正确应用于另一个语料库?

machine-learning - 艾伯特不收敛 - HuggingFace

python-3.x - 需要构建自定义 NER 的方法,以便从任何格式的工资单中提取以下关键字