NER interfere with REGEXNER
Asked Answered
G

1

2

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)

}

Gallman answered 18/9, 2015 at 0:23 Comment(0)
N
2

If you add regexner after the ner annotator it should work:

props.put("annotators", "tokenize, ssplit, pos, lemma, ner, regexner")
Northnorthwest answered 18/9, 2015 at 9:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.