Stanford NLP 安装与初步使用
来源:互联网 发布:软件项目管理制度 编辑:程序博客网 时间:2024/06/05 23:08
1.如何使用CoreNLP工具
通过Maven来使用
后面两个dependency是导入model用的,支持的语言包括英语、汉语、法语、西班牙语和德语。默认情况下CoreNLP是支持英语的,其他语言的model需要独立下载。
<dependency> <groupId>edu.stanford.nlp</groupId> <artifactId>stanford-corenlp</artifactId> <version>3.6.0</version></dependency><dependency> <groupId>edu.stanford.nlp</groupId> <artifactId>stanford-corenlp</artifactId> <version>3.6.0</version> <classifier>models</classifier></dependency><!-- 解析中文需要下面这个包 --> <dependency> <groupId>edu.stanford.nlp</groupId> <artifactId>stanford-corenlp</artifactId> <version>3.6.0</version> <classifier>models-chinese</classifier></dependency><!-- 使用 Simple CoreNLP API 需要而外下面两个包 --><dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-nop</artifactId> <version>1.7.12</version></dependency><dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> <version>3.1.0</version></dependency>
2.简单上手CoreNLP
在代码中使用Simple CoreNLP API顾名思义,Simple CoreNLP API是相对于Stanford CoreNLP API比较简单的API操作方式。
import edu.stanford.nlp.simple.*;public class SimpleCoreNLPDemo { public static void main(String[] args) { // Create a document. No computation is done yet. Document doc = new Document("add your text here! It can contain multiple sentences."); for (Sentence sent : doc.sentences()) { // Will iterate over two sentences // We're only asking for words -- no need to load any models yet System.out.println("The second word of the sentence '" + sent + "' is " + sent.word(1)); // When we ask for the lemma, it will load and run the part of speech tagger System.out.println("The third lemma of the sentence '" + sent + "' is " + sent.lemma(2)); // When we ask for the parse, it will load and run the parser System.out.println("The parse of the sentence '" + sent + "' is " + sent.parse()); // ... } }}
0 0
- Stanford NLP 安装与初步使用
- Stanford Core NLP 安装
- Stanford nlp 初步之词性标注
- Stanford NLP Chinese(中文)的使用
- 【NLP】play with stanford nlp
- 使用Stanford NLP工具实现中文命名实体识别
- 使用Stanford NLP software进行中文文本预处理
- 干货!详述Python NLTK下如何使用stanford NLP工具包
- Stanford Core NLP
- NLP之Stanford Parser
- EVC4 安装与初步使用
- EVC4 安装与初步使用
- Memcached安装与初步使用
- 安装与初步使用Theos
- NLTK使用Stanford parser方法,可类推Stanford其他nlp工具
- stanford-NLP-CLASS1课堂笔记
- Stanford NLP工具--句法分析
- log4cplus的安装与使用初步
- ML数学知识琐碎
- 修改linux系统root密码
- 内存分配的原理__进程分配内存有两种方式,分别由两个系统调用完成:brk和mmap(不考虑共享内存)。
- php 基础之GD库
- python dom方法遍历某文件夹下所有xml
- Stanford NLP 安装与初步使用
- android之Toolbar取消子控件左边留白
- [李景山php]每天laravel-20161103|CompilerEngine.php-2
- oracle 数据库分区
- mac的svn之cornerstone简易使用
- 《React-Native系列》26、 ReactNative实现图片上传功能
- MSSQL之二十一 存储过程案例
- Android Menu
- LeetCode 191 Number of 1 Bits (位运算)