scala - NER 干扰 REGEXNER

标签 scala stanford-nlp named-entity-recognition

我使用 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/

相关文章:

string - 为什么我得到的字符串长度值不正确?

java - 将 HTTP POST 二进制有效负载获取到 Scala 中的字节数组

python - nltk StanfordNERTagger : How to get proper nouns without capitalization

java - 自定义 OpenNLP 名称查找器可识别训练集中的数据,但无法识别测试集中的数据

azure - 命名实体识别 - 我们是否需要外部列表来匹配结果?

scala - 我将如何在Scala中表达一个链式的任务?

scala - 如何使 scala List of Any 具有强制属性?

java - model.ser.gz 位于斯坦福 corenlp 的哪里?

python - Stanford NER 和 POS,大数据的多线程

nlp - 用 SpaCy 中的标签替换实体