开源一个文本分析项目

简介: 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 进行预定。感谢各位朋友。

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

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

目录
相关文章
|
存储 缓存 监控
JVM 21 的调优指南:如何进行JVM调优,JVM调优参数
聊聊关于JVM 21的优化指南。这篇文章将会深入探讨如何进行JVM调优,介绍一些关键的JVM调优参数,并提供12个实用的代码示例。由于篇幅较长,我会分几个部分来详细讲解,之前写的也有33篇系列教程JVM调优实战打击也可以去围观。
775 0
|
6月前
|
人工智能 前端开发 Java
2025 开发必备:精选免费 AI 辅助工具,效率狂飙不停
2025年,AI技术深度融入编程领域,诞生了多款免费且功能强大的辅助工具。通义灵码精通200多种语言,可快速生成代码框架,提升开发效率超10%,还为新手提供学习指导。Google Gemini Code Assist每月完成18万次代码补全,支持智能交互与代码审查,优化团队协作。飞算JavaAI专注Java全流程开发,从需求分析到代码生成实现十倍提效。这些工具大幅降低编程门槛,助力开发者高效高质完成任务。
|
Web App开发 缓存 前端开发
【Flutter前端技术开发专栏】Flutter中的性能优化与内存管理
【4月更文挑战第30天】本文探讨了Flutter应用的性能优化和内存管理。关键点包括:减少布局重绘(使用`const`构造函数和最小化依赖),选择合适的动画实现,懒加载和按需加载以提升性能。同时,强调了避免内存泄漏和优化内存使用,利用Flutter提供的性能分析工具。实践案例展示了如何优化ListView,包括使用`ListView.builder`和缓存策略。通过这些方法,开发者可以提升应用的响应性、流畅性和稳定性。
613 0
【Flutter前端技术开发专栏】Flutter中的性能优化与内存管理
|
机器学习/深度学习 数据可视化 大数据
K值进行交叉验证
8月更文挑战第16天
|
10月前
|
移动开发 JavaScript 前端开发
简单易用的jquery响应式轮播图插件ma5slider
ma5slider是一款简单易用的jquery响应式轮播图插件。该轮播图支持鼠标拖拽,可以通过CSS定制外观,支持无限循环模式,内置水平,垂直和淡入淡出三种轮播图过渡动画效果。
|
机器学习/深度学习 算法 PyTorch
PyTorch 模型性能分析和优化 - 第 6 部分
PyTorch 模型性能分析和优化 - 第 6 部分
|
10月前
|
前端开发 JavaScript C++
Marp 教程:实现幻灯片动画效果
Marp 是一个基于 Markdown 的幻灯片制作工具,结合 VSCode 的强大编辑功能,可以让你的 PPT 制作更加高效和专业。本教程详细介绍了如何在 Marp 中使用 CSS 和 JavaScript 实现幻灯片的动画效果,包括淡入、滑动、旋转等基本动画,以及交互式动画和图表动画等高级效果。通过这些技巧,你可以制作出更加生动、吸引眼球的演示文稿。
317 0
|
编解码 网络架构
802.11a 标准的数据速率是多少?
【8月更文挑战第24天】
725 0
|
数据采集 Go Python
文本挖掘基础入门指南
本文介绍了文本挖掘中的数据预处理步骤,包括去除特殊字符和标点符号、移除停用词、小写化以及词干化或词形还原。使用Python的nltk库,通过示例代码展示了如何实现这些步骤,并强调了nltk库在文本处理中的便利性。文章最后提到,预处理后的文本更适合后续的文本分析任务.
AspectJ的工作原理
【5月更文挑战第1天】AspectJ的工作原理
304 3