具有训练数据的命名实体识别

时间:2013-11-19 14:07:54

标签: r nlp opennlp named-entity-recognition

我的文本文件t1.txt包含此

<START:name> Ashish Sanadhya <END> , 61 years old , will join the board as a nonexecutive director Nov. 29 .
Mr . <START:name> mayank sharma <END> is chairman of Elsevier N.V. , the Dutch publishing group .

和t2.txt包含

person mayank sharma
persons ashish sanadhya
organizations linkedin

我已经训练了数据,因为图片显示enter image description here 但是当试图恢复所需的结果时,如

>s <- paste(c("I am ashish ."))
> a2 <- annotate(s, list(sent_token_annotator, word_token_annotator))
> entity_annotator <-  Maxent_Entity_Annotator(language = "en", kind = c("person"), probs = FALSE,model ="C:\\apache-opennlp-1.5.3\\en-ner-person.bin")
>  entity_annotator(s, a2)
  [1] id    type  start end  
<0 rows> (or 0-length row.names)

我在培训人员实体后期待结果

 entity_annotator(s, a2)
 id type   start end features   
 1  entity 6    11  kind=person
 s[entity_annotator(s, a2)]
 ashish

任何帮助,为什么我没有得到预期的结果。谢谢,这个方向的任何帮助

EDITED

我从here下载文件 en-ner-person.bin cutoff 参数为我工作,我使用了这个命令

c:\apache-opennlp-1.5.3>bin\opennlp TokenNameFinderTrainer -cutoff 1 -lang en -encoding UTF-8 -data "c:\t7.txt" -model en-ner-person.bin

希望对Daniel Naber有所帮助,特别感谢。

0 个答案:

没有答案