开源一个文本分析项目

简介: Githubhttps://github.com/sea-boat/TextAnalyzerTextAnalyzera text analizer that can analyze text.

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

  1. indexing a document and get a docId.
long docId = TextIndexer.index(text);
  1. 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

  1. training the samples.
SVMTrainer trainer = new SVMTrainer();
trainer.train();
  1. 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);

==========广告时间==========

鄙人的新书《Tomcat内核设计剖析》已经在京东预售了,有需要的朋友可以到 https://item.jd.com/12185360.html 进行预定。感谢各位朋友。

=========================

欢迎关注:
这里写图片描述

目录
相关文章
|
1月前
|
人工智能 大数据 数据处理
【开源项目推荐】8.9K纯中文本地GPT知识库搭建项目
【开源项目推荐】8.9K纯中文本地GPT知识库搭建项目
647 0
|
28天前
|
人工智能 数据安全/隐私保护
|
1月前
|
数据采集 Go Python
文本挖掘基础入门指南
本文介绍了文本挖掘中的数据预处理步骤,包括去除特殊字符和标点符号、移除停用词、小写化以及词干化或词形还原。使用Python的nltk库,通过示例代码展示了如何实现这些步骤,并强调了nltk库在文本处理中的便利性。文章最后提到,预处理后的文本更适合后续的文本分析任务.
|
10月前
|
JSON 人工智能 自然语言处理
HarmonyOS学习路之开发篇—AI功能开发(分词)
分词概述 随着信息技术的发展,网络中的信息量成几何级增长逐步成为当今社会的主要特征。准确提取文本关键信息,是搜索引擎等领域的技术基础,而分词作为文本信息提取的第一步则尤为重要。
|
11月前
|
机器学习/深度学习 自然语言处理 机器人
开源大模型文档
开源大模型文档
977 0
|
11月前
|
SQL 人工智能 自然语言处理
SolidUI AI生成可视化,开创性开源项目,版本0.1.0 功能讲解
SolidUI AI生成可视化,开创性开源项目,版本0.1.0 功能讲解
130 0
|
自然语言处理 文字识别 达摩院
|
自然语言处理 达摩院 开发者
|
自然语言处理 知识图谱
|
编解码 人工智能 自然语言处理
开源AltDiffusion-m18 ,18种语言文图生成all in one
开源AltDiffusion-m18 ,18种语言文图生成all in one
119 0