LingPipe是一个自然语言处理的Java开源工具包。LingPipe目前已有很丰富的功能,包括主题分类(Top Classification)、命名实体识别(Named Entity Recognition)、词性标注(Part-of Speech Tagging)、句题检测(Sentence Detection)、查询拼写检查(Query Spell Checking)、兴趣短语检测(Interseting Phrase Detection)、聚类(Clustering)、字符语言建模(Character Language Modeling)、医学文献下载/解析/索引(MEDLINE Download, Parsing and Indexing)、数据库文本挖掘(Database Text Mining)、中文分词(Chinese Word Segmentation)、情感分析(Sentiment Analysis)、语言辨别(Language Identification)等API。
lingpipe 是alias公司开发的一款自然语言处理软件包,目前(2008.04.21)最高版本是3.5([url]http://www.5yiso.cn/2008 /04/28856.html[/url]),功能非常强大,最重要的是文档超级详细,每个模型甚至连参考论文都列出来了,不仅使用方便,也非常适合模型的学习。
地址:
http:/alias-i.com/lingpipe/
SIGHAN06中有一篇paper, 关于Alias-i公司的Bob Carpenter所提交的参评报告”Character Language Models for Chinese Word Segmentation and Named Entity Recognition”看到了他们开发的LingPipe NLP Toolkit,一个自然语言处理的Java开源工具包。可以免费下载,而且开源,支持中文,不仅仅是对代码结构的说明,而且还提供了算法思想文档和相关 的资源,如测试数据集、相关论文等,一个不错的toolkit。
包括的模块:
主题分类(Top Classification)、命名实体识别(Named Entity Recognition)、词性标注(Part-of Speech Tagging)、句题检测(Sentence Detection)、查询拼写检查(Query Spell Checking)、兴趣短语检测(Interseting Phrase Detection)、聚类(Clustering)、字符语言建模(Character Language Modeling)、医学文献下载/解析/索引(MEDLINE Download, Parsing and Indexing)、数据库文本挖掘(Database Text Mining)、中文分词(Chinese Word Segmentation)、情感分析(Sentiment Analysis)、语言辨别(Language Identification)等
Feature Overview
LingPipe’s information extraction and data mining tools:
* track mentions of entities (e.g. people or proteins); 实体跟踪(如,人物、蛋白质)
* link entity mentions to database entries; 链接命名实体数据库中记录
* uncover relations between entities and actions; 发现实现和行为间关系
* classify text passages by language, character encoding, genre, topic, or sentiment; 通过语言、字体编码、类型、主题和情感对文本分类
* correct spelling with respect to a text collection; 拼写检查
* cluster documents by implicit topic and discover significant trends over time; and 通过隐藏主题对文档聚类和基于时间序列的趋势发现
* provide part-of-speech tagging and phrase chunking. 提供词性标注和短语组块
----------------------------------------
如何使用LingPipe计算词向量
如何使用LingPipe抽取向量空间模型例子
import com.aliasi.matrix.SparseFloatVector;
import com.aliasi.matrix.Vector;
import com.aliasi.symbol.MapSymbolTable;
import com.aliasi.symbol.SymbolTable;
import com.aliasi.tokenizer.IndoEuropeanTokenizerFactory;
import com.aliasi.tokenizer.TokenizerFactory;
import com.aliasi.tokenizer.TokenFeatureExtractor;
import java.util.HashMap;
import java.util.Map;
public class ExtractFeatures {
public static Vector[] featureVectors(String[] texts,
SymbolTable symbolTable) {
Vector[] vectors = new Vector[texts.length];
TokenizerFactory tokenizerFactory = new IndoEuropeanTokenizerFactory();
TokenFeatureExtractor featureExtractor = new TokenFeatureExtractor(
tokenizerFactory);
for (int i = 0; i < texts.length; ++i) {
Map featureMap = featureExtractor
.features(texts[i]);
vectors[i] = toVectorAddSymbols(featureMap, symbolTable,
Integer.MAX_VALUE);
}
return vectors;
}
public static SparseFloatVector toVectorAddSymbols(
Map featureVector, SymbolTable table,
int numDimensions) {
int size = (featureVector.size() * 3) / 2;
Map vectorMap = new HashMap(size);
for (Map.Entry entry : featureVector
.entrySet()) {
String feature = entry.getKey();
Number val = entry.getValue();
int id = table.getOrAddSymbol(feature);
vectorMap.put(new Integer(id), val);
}
return new SparseFloatVector(vectorMap, numDimensions);
}
public static void main(String[] args) {
args = new String[]{"this is a book", "go to school"
};
SymbolTable symbolTable = new MapSymbolTable();
Vector[] vectors = featureVectors(args, symbolTable);
System.out.println("VECTORS");
for (int i = 0; i < vectors.length; ++i)
System.out.println(i + ") " + vectors[i]);
System.out.println(" SYMBOL TABLE");
System.out.println(symbolTable);
}
}
-------------------------------
如何使用LingPipe 计算TF-IDF[b]
By jeffye | 五月 25, 2008
Hope that the following java code can help you:
---------------------------------------------------------
import com.aliasi.spell.TfIdfDistance;
import com.aliasi.tokenizer.IndoEuropeanTokenizerFactory;
import com.aliasi.tokenizer.TokenizerFactory;
public class TfIdfDistanceDemo {
public static void main(String[] args) {
TokenizerFactory tokenizerFactory =
IndoEuropeanTokenizerFactory.FACTORY;
TfIdfDistance tfIdf = new TfIdfDistance(tokenizerFactory);
for (String s : args)
tfIdf.trainIdf(s);
System.out.printf("n %18s %8s %8sn",
"Term", "Doc Freq", "IDF");
for (String term : tfIdf.termSet())
System.out.printf(" %18s %8d %8.2fn",term,tfIdf.docFrequency(term),
tfIdf.idf(term));
for (String s1 : args) {
for (String s2 : args) {
System.out.println("nString1=" + s1);
System.out.println("String2=" + s2);
System.out.printf("distance=%4.2f proximity=%4.2fn",
tfIdf.distance(s1,s2),
tfIdf.proximity(s1,s2));
}
}
}
}
[/b]------------------
分享到:
相关推荐
Lingpipe(自然语言处理的Java开源工具包)入门
最新自然语言处理的Java开源工具包-LingPipe3.7.0
,LingPipe(开源自然语言处理的Java开源工具包) 中文分词java程序
java实现基于自然语言处理技术进行情感分析源码.zip 代码完整确保可以运行,下载即用无需修改。 java实现基于自然语言处理技术进行情感分析源码.zip 代码完整确保可以运行,下载即用无需修改。java实现基于自然...
细介绍自然语言处理各主要领域的原理以Java 实现,包括中文分词、词性标注、依存句法分析等。其中详细介绍了中文分词和词性标注的过程及相关算法,如隐马尔可夫模型等。在自然语言处理的应用领域主要介绍了信息抽取...
这个是关于使用java进行自然语言处理时用到的jar包,比如分词等等
hanlp上相关代码文件面向生产环境的多语种自然语言处理工具包,基于 TensorFlow 2.x,目标是普及落地最前沿的NLP技术。HanLP具备功能完善、性能高效、架构清晰、语料时新、可自定义的特点。目前,基于深度学习的...
自然语言处理(汉语)算法实现,Java语言实现,经过优化,效率很高。主要包括: 1)汉语分词,采用ICTCLAS系统和Lucene+庖丁解牛系统 2)情感倾向性分析,包括基于统计学习的SVM算法,基于情感词典的词语权重算法,给...
Java 实现的自然语言处理 中文分词 词性标注 命名实体识别 依存句法分析 关键词提取 自动摘要 短语提取 拼音 简繁转换。.zip,自然语言处理 中文分词 词性标注 命名实体识别 依存句法分析 新词发现 关键词短语提取 ...
中文分词/宋词生成/n-gram模型/全部java源代码,课程设计报告。全部源代码,详细注释。
NLP is at the core of web search, intelligent personal assistants, marketing, and much more, and LingPipe is a toolkit for processing text using computational linguistics. This book starts with the ...
java开发环境配置及配置过程中可能遇到的问题整理
java语言实现的中文自动分词软件,包含工程源码、可执行文件以及测试文件。该分词程序的切词正率和召回率较高。
Java 自然语言处理库 以下是通过 NLP4J 使用斯坦福 NLP 的简单示例 Maven <!-- https://mvnrepository.com/artifact/org.nlp4j/nlp4j-stanford --> < groupId>org.nlp4j < artifactId>nlp4j-core [1.3....
基于自然语言处理的咨询平台知识库系统 基于自然语言处理的知识库系统、咨询、问答库 项目采用maven的项目管理工具管理,并且采用的Spring cloud、SpringBoot微服务框架开发。此处建议使用idea工具进行编辑开发。
本书详细介绍自然语言处理各主要领域的原理以Java 实现。仅做学习交流
《数字图像处理:JAVA语言实现》的教程及源代码
正规java语言教材,大学教材,java基础,带习题巩固Java语言以其完全面向对象、简单高教、与平台无关等突出的特点,已经逐渐成为程序设计的首选语言。 本书共12章,从程序设计方法讲起,详细介绍了Java开发环境、...
Natural Language Processing with Java and LingPipe Cookbook 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源...
简单的自然语言初级处理,用Java语言实现的自动分词。分为两个包