NER正在改写斯坦福NLP中的自定义NER [英] NER is over writing the custom NERin stanford NLP
问题描述
在斯坦福大学nlp中,我使用了一种模式来匹配regexner中的电话号码.但是NER已将其写为Number.
In the stanford nlp, I used a pattern to match the phone number in regexner. But the NER is over writing it as Number.
如果我删除了ner注释,那么它将显示为PHONE_NUMBER. 你们中的任何一个可以帮助我吗?
If I remove the ner annotation then it is showing as PHONE_NUMBER. Can any one of you please help me.
预先感谢.
这是我的正则表达式行:
Here is my regexner line:
^(?:(?:\+|0{0,2})91(\s*[\-]\s*)?|[0]?)?[789]\d{9}$ PHONENUMBER
推荐答案
java命令:
java -Xmx10g edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,lemma,ner -file phone-number-example.txt -outputFormat text -ner.fine.regexner.mapping phone-number-regex.rules
示例文字:
I will call him at 555-555-5555
规则文件的格式:
555-555-5555 PHONE_NUMBER NUMBER 1
(请注意各列用制表符分隔)
(note the columns are tab delimited)
将在统计NER之后应用细粒度的NER.您还可以构建自定义regexner
并在统计模型之后运行它.关键是告诉它覆盖NUMBER标签(在第三列中指出).
The fine-grained NER will be applied after the statistical NER. You can also build a custom regexner
and run it after the statistical model. The key is telling it to overwrite the NUMBER tag (which is indicated in the third column).
这篇关于NER正在改写斯坦福NLP中的自定义NER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!