开源一个文本分析项目
来源:互联网 发布:淘宝手机卖场 编辑:程序博客网 时间:2024/06/04 21:50
Github
https://github.com/sea-boat/TextAnalyzer
TextAnalyzer
a text analizer that can analyze text. so far, it can extract hot words in a text segment by using tf-idf algorithm,at the same time using a score factor to optimize the final score.
also it provides machine learning to make a classification.
Features
extracting hot words from a text.
1. to gather statistics via frequence.
2. to gather statistics via by tf-idf algorithm
3. to gather statistics via a score factor additionally.
synonym can be recognized
SVM Classificator
this analyzer supports to classify text by svm. it involves vectoring the text. we can train the samples and then make a classification by the model.
for convenience,the model,tfidf and vector will be stored.
kmeans clustering && xmeans clustering
this analyzer supports to clustering text by kmeans and xmeans.
vsm clustering
this analyzer supports to clustering text by vsm.
Dependence
https://github.com/sea-boat/IKAnalyzer-Mirror.git
TODO
- other ml algorithms.
- emotion analization.
How to use
just simple like this
extracting hot words
- indexing a document and get a docId.
long docId = TextIndexer.index(text);
- extracting by docId.
HotWordExtractor extractor = new HotWordExtractor(); List<Result> list = extractor.extract(0, 20, false); if (list != null) for (Result s : list) System.out.println(s.getTerm() + " : " + s.getFrequency() + " : " + s.getScore());
a result contains term,frequency and score.
失业证 : 1 : 0.31436604户口 : 1 : 0.30099702单位 : 1 : 0.29152703提取 : 1 : 0.27927202领取 : 1 : 0.27581802职工 : 1 : 0.27381304劳动 : 1 : 0.27370203关系 : 1 : 0.27080503本市 : 1 : 0.27080503终止 : 1 : 0.27080503
SVM classificator
- training the samples.
SVMTrainer trainer = new SVMTrainer();trainer.train();
- predicting text classification.
double[] data = trainer.getWordVector(text);trainer.predict(data);
kmeans clustering && xmeans clustering
List<String> list = DataReader.readContent(KMeansCluster.DATA_FILE);int[] labels = new KMeansCluster().learn(list);
vsm clustering
List<String> list = DataReader.readContent(VSMCluster.DATA_FILE);List<String> labels = new VSMCluster().learn(list);
==========广告时间==========
公众号的菜单已分为“分布式”、“机器学习”、“深度学习”、“NLP”、“Java深度”、“Java并发核心”、“JDK源码”、“Tomcat内核”等,可能有一款适合你的胃口。
鄙人的新书《Tomcat内核设计剖析》已经在京东销售了,有需要的朋友可以购买。感谢各位朋友。
为什么写《Tomcat内核设计剖析》
=========================
欢迎关注:
- 开源一个文本分析项目
- 开源项目Logger源码分析-----一个好看、简单、强大的logcat信息输出项目
- 关于文本分析的一个访谈
- 一个文本抽取分析的shell程序
- 一个SOA项目性能分析
- 移动一个HTML5项目分析
- 文本分类、聚类的开源项目
- 分析一个英文txt文本中单词出现的频率
- 一个开源、功能强大的富文本编辑器
- 参与一个开源项目
- 瓣呀,一个开源项目
- 如何分析一个开放源代码的项目
- 如何分析一个开放源代码的项目
- 如何分析一个开放源代码的项目
- 如何分析一个开放源代码的项目
- 文本分析--情感分析
- 【文本】简易文本编辑器分析
- 批量开源项目分析网站
- 分布式事务之说说TCC事务
- Js中数组的常见操作
- 创建定时任务—Timer与Alarm
- liunx (centos )redis下载安装配置最新
- Intellij IDEA svn的使用详解
- 开源一个文本分析项目
- 待写博客列表
- Linux高性能服务器之多路转接(1)----select模型实现
- Android 中CollapsingToolbarLayout和Toolbar实现炫酷效果
- MySQL InnoDB中各类语句加锁方式
- Bit Twiddling Hacks
- docker(二)docker容器使用
- liunx (centos) JDK环境配置
- JAVA线程间协作:wait.notify.notifyAll