在Stanford CoreNLP中创建一个新的注释器

时间:2017-01-30 12:32:19

标签: annotations text-processing stanford-nlp

我需要创建并添加一个新的注释器来分析Stanford CoreNLP中的文本。有添加新注释器的解决方案。我无法找到如何创建新的注释器?

我需要在Stanford CoreNLP注释器列表中为Newsfeed源名称创建一个新的注释器。

感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

the documentation中所述,您需要实现Annotator接口,使用参数@foreach($comments as $comment) {{ $comment->content }} @if ( $comment->replies ) @foreach($comment->replies as $rep1) {{ $rep1->content }} ... @endforeach @endif @endforeach 的构造函数,然后在传递给CoreNLP的属性文件中,设置参数< / p>

MyAnnotator(String, java.util.Properties)

例如:

customAnnotatorClass.NAME=CLASS

然后,您可以通过定义属性将属性传递给注释器:

customAnnotatorClass.myann=com.domain.package.MyAnnotator

这些将显示在传递给您创建的Annotator的构造函数的myann.myprop=myvalue myann.otherprop=othervalue 对象中。

可以用作自定义注释器应该看起来像模板的小注释器的一个很好的例子可以是Gender annotator

相关问题