Get list of annotators in Stanford CoreNLP

563 views Asked by At

I'm customizing Stanford CoreNLP by adding some new Annotators, each one with its requirements. Is there a way to get the list of requirements and satisfactions from the StanfordCoreNLP object?

For example, I instantiate the CoreNLP object:

Properties props = new Properties();
props.setProperty("annotators", "tokenize, ssplit, pos, lemma");
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);

I'd like to know, starting from pipeline: (i) there is four annotators (tokenize, ssplit, pos, lemma); (ii) pos depends on tokenize and ssplit, lemma depends on tokenize, ssplit and pos, and so on.

Is it possible?

1

There are 1 answers

0
Jon Gauthier On BEST ANSWER

Looking at the code behind the pipeline, it looks it's not currently possible to get the list of annotators enabled for an already-constructed pipeline (i). All of the relevant members storing this information are private.

You could probably hack something up to get the annotator dependencies (ii), but it wouldn't be pretty. See how the core code does this in the StanfordCoreNLP implementation.