【发布时间】:2015-06-08 08:43:27
【问题描述】:
我标记了一个简单的句子,这是我的代码:
package tagger;
import edu.stanford.nlp.tagger.maxent.MaxentTagger;
public class myTag {
public static void main(String[] args) {
MaxentTagger tagger = new MaxentTagger("D:/tagger/english-bidirectional-distsim.tagger");
String sample = "i go to school by bus";
String tagged = tagger.tagString(sample);
System.out.println(tagged);
}
}
这是输出:
Reading POS tagger model from D:/tagger/english-bidirectional-distsim.tagger ... done [3.0 sec].
i_LS go_VB to_TO school_NN by_IN bus_NN
编辑属性文件后它根本没有任何效果。 例如,我已将标签分隔符更改为 ( * ),但在输出中它仍然打印 ( _ )。
如何在 eclipse 中使用模型配置文件?
【问题讨论】:
-
注意双向模型is not generally the best model to use in real-world applications。还有其他模型会牺牲少量的准确性来大幅提高速度。
标签: java nlp stanford-nlp maxent