Stanford Log-linear Part-Of-Speech Tagger学习

来源:互联网 发布:南京行知小学宿舍 编辑:程序博客网 时间:2024/06/05 02:14

主页:https://nlp.stanford.edu/software/tagger.html

下载:
这里写图片描述

basic English Stanford Tagger version 只包括训练好的英文模型,而 full Stanford Tagger version 包括多种语言模型,其中有英文,中文,德语等模型。

一个简单的Demo:

import java.io.IOException;  import edu.stanford.nlp.tagger.maxent.MaxentTagger;   public class POS2WORD   {          public static void main(String[] args) throws IOException,ClassNotFoundException       {                 // Initialize the tagger  载入已经训练好的模型                MaxentTagger tagger = new MaxentTagger("models/english-left3words-distsim.tagger");                   // The sample string                  String sample = "text love my us like my you";                   // The tagged string                  String tagged = tagger.tagString(sample);           // Output the result                  System.out.println(tagged);         }  }  

结果:
这里写图片描述

原创粉丝点击