hankcs / lda4j Goto Github PK
View Code? Open in Web Editor NEWA Java implemention of LDA(Latent Dirichlet Allocation)
Home Page: http://www.hankcs.com/nlp/lda-java-introduction-and-implementation.html
A Java implemention of LDA(Latent Dirichlet Allocation)
Home Page: http://www.hankcs.com/nlp/lda-java-introduction-and-implementation.html
phi never be used in inference?
ldautil第41行应改为for (int i = 0; i < limit && iterator.hasNext() ; ++i),否则limit超过iterator的大小的时候会报错
首先感谢hankcs博主的分享,在使用LDA4j的过程中,我重写了Corpus类里的load和loadDocument方法,从数据库中读写数据测试成功。
但是测试的过程中遇到了一个问题,就是先用训练集训练出来phi,然后拿来一个新文档使用这个phi推断其概率分布发现报数组越界的错误,我初步调试发现一旦新文档中包含训练集中没有的生单词,你写的Inference便无法使用,这个问题希望博主能进行一下异常处理。
有相关的api文档吗,请问如何获得新文档的主题分布?
int[] document = Corpus.loadDocument("data/mini/军事_510.txt", corpus.getVocabulary());
double[] tp = LdaGibbsSampler.inference(phi, document);
Map<String, Double> topic = LdaUtil.translate(tp, phi, corpus.getVocabulary(), 100);
LdaUtil.explain(topic);
LdaUtil
Map<Double, String> rankMap = new TreeMap<Double, String>(Collections.reverseOrder());
把double和string互换一下谢谢
请问这里的参数含义,感谢!!!
想使用LDA4j但是怎样下载?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.