我使用 regexner 来查找不在斯坦福自然语言处理默认集中的命名实体,它工作得很好。但是,当我添加 ner 注释器时,它会用默认标签注释与我的正则表达式匹配的标记。如何覆盖默认注释?
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,它应该可以工作:
props.put("annotators", "tokenize, ssplit, pos, lemma, ner, regexner")
关于scala - NER 干扰 REGEXNER,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32642008/