NER干扰REGEXNER [英] NER interfere with REGEXNER
本文介绍了NER干扰REGEXNER的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用regexner查找不在Stanford NLP的默认集合中的命名实体,并且工作正常.但是,当我添加ner注释器时,它将使用默认标签注释与我的正则表达式匹配的标记.如何覆盖默认注释?
I use regexner to find named entities that are not in the default set of Stanford NLP and it works fine. However, when I add ner annotator, it annotates tokens that match my regular expression with default tags. How can I overwrite default annotations?
def createNLPPipelineRegex(): StanfordCoreNLP = {
val props = new Properties()
props.put("regexner.mapping", "regex.txt")
props.put("annotators", "tokenize, ssplit, regexner, pos, lemma, ner")
props.put("tokenize.options", "untokenizable=noneKeep,normalizeParentheses=false")
new StanfordCoreNLP(props)
}
推荐答案
如果您在ner注释器后添加regexner,它将起作用:
If you add regexner after the ner annotator it should work:
props.put("annotators", "tokenize, ssplit, pos, lemma, ner, regexner")
这篇关于NER干扰REGEXNER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文