Error creating Stanford CoreNLP

When I create Core-NLP myself, I get the following message:

incompatible types; no instance(s) of type variable(s) VALUE exist so that VALUE conforms to Map<Integer,String> 

Line of violation:

 Map<Integer,String> roleMap = ((CoreLabel)t1.label()).get(CoreAnnotations.CoNLLSRLAnnotation.class); 

Violating function:

  @SuppressWarnings("unchecked") public <VALUE, KEY extends Key<CoreMap, VALUE>> VALUE get(Class<KEY> key) { for (int i = size; i > 0; ) { if (keys[--i] == key) { return (VALUE)values[i]; } } return null; } 

I really don't know how to fix this. I am trying to create CoreNLP with Maven so that I can easily use it in my project. Ideas?

+6
source share
2 answers

Not for me, but just a friendly reminder to all of us: RTFM.

http://nlp.stanford.edu/software/lex-parser.shtml

Usage Notes

The current version of the parser requires Java 8 (JDK1.8) or later. (You can also> download the old version of the analyzer version 1.4, which works under JDK 1.4, version 2.0, which works under JDK 1.5, version 3.4.1, which works under JDK 1.6, but these distributions are no longer supported.) The parser also requires a reasonable amount of memory (at least 100 MB to work as a PCFG parser on sentences up to 40 words long, usually about 500 MB of memory, in order to be able to analyze similarly long sentences with typical news using a factor model).

+2
source

Where do you get your source?

I had no problems building from the main branch in their github repository . I am using java 1.8, which is required in their maven pom.

+1
source

Source: https://habr.com/ru/post/899890/


All Articles