CogComp / cogcomp-nlp

CogComp's Natural Language Processing Libraries and Demos: Modules include lemmatizer, ner, pos, prep-srl, quantifier, question type, relation-extraction, similarity, temporal normalizer, tokenizer, transliteration, verb-sense, and more.
http://nlp.cogcomp.org/
Other
473 stars 142 forks source link

Error "Attempted to access negative index of FVector.! #695

Open PhdStudent2015 opened 6 years ago

PhdStudent2015 commented 6 years ago

I'm tried the provided example in the cogcomp-nlp readme and a got a wierd Error that could not figure out how to solve it. Please me. My code : `String text = "He went to Chicago after his Father moved there.";

        String corpus = "story";
        String textId = "001";
        AnnotatorService annotator = PipelineFactory.buildPipeline(ViewNames.POS, ViewNames.NER_CONLL);
        TextAnnotation ta = annotator.createAnnotatedTextAnnotation(corpus, textId, text);
        View mentionView = ta.getView(ViewNames.POS);
        System.out.println("Pos Values: ");
        mentionView.getConstituents().forEach(v->System.out.println(v));`

Pom.xml `

junit junit 3.8.1 test
    <dependency>
        <groupId>edu.illinois.cs.cogcomp</groupId>
        <artifactId>illinois-pos</artifactId>
        <version>4.0.13</version>
    </dependency>
    <dependency>
        <groupId>edu.illinois.cs.cogcomp</groupId>
        <artifactId>illinois-tokenizer</artifactId>
        <version>4.0.13</version>
    </dependency>
    <dependency>
        <groupId>edu.illinois.cs.cogcomp</groupId>
        <artifactId>illinois-nlp-pipeline</artifactId>
        <version>4.0.13</version>
    </dependency>
</dependencies>
<repositories>
    <repository>
        <id>CogCompSoftware</id>
        <name>CogCompSoftware</name>
        <url>http://cogcomp.org/m2repo/</url>
    </repository>
</repositories>

`

The error: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Attempted to access negative index of FVector. at edu.illinois.cs.cogcomp.lbjava.util.FVector.boundsCheck(FVector.java:89) at edu.illinois.cs.cogcomp.lbjava.util.FVector.get(FVector.java:116) at edu.illinois.cs.cogcomp.lbjava.util.FVector.get(FVector.java:103) at edu.illinois.cs.cogcomp.lbjava.learn.SparseNetworkLearner.valueOf(SparseNetworkLearner.java:589) at edu.illinois.cs.cogcomp.lbjava.learn.SparseNetworkLearner.valueOf(SparseNetworkLearner.java:529) at edu.illinois.cs.cogcomp.pos.lbjava.POSTaggerUnknown.cachedFeatureValue(POSTaggerUnknown.java:89) at edu.illinois.cs.cogcomp.pos.lbjava.POSTaggerUnknown.discreteValue(POSTaggerUnknown.java:120) at edu.illinois.cs.cogcomp.pos.lbjava.POSTagger.discreteValue(POSTagger.java:79) at edu.illinois.cs.cogcomp.pos.POSAnnotator.addView(POSAnnotator.java:94) at edu.illinois.cs.cogcomp.annotation.Annotator.lazyAddView(Annotator.java:203) at edu.illinois.cs.cogcomp.annotation.Annotator.getView(Annotator.java:167) at edu.illinois.cs.cogcomp.pipeline.main.SentencePipeline.processBySentence(SentencePipeline.java:112) at edu.illinois.cs.cogcomp.pipeline.main.SentencePipeline.addView(SentencePipeline.java:88) at edu.illinois.cs.cogcomp.annotation.BasicAnnotatorService.addViewsAndCache(BasicAnnotatorService.java:400) at edu.illinois.cs.cogcomp.annotation.BasicAnnotatorService.createAnnotatedTextAnnotation(BasicAnnotatorService.java:378) at edu.illinois.cs.cogcomp.annotation.BasicAnnotatorService.createAnnotatedTextAnnotation(BasicAnnotatorService.java:193) at org.picwm.nlptools.cogcomp.CompDemo.CogCompDemo.main(CogCompDemo.java:37)

danyaljj commented 6 years ago

Sorry for the inconvenience. Can you try the version "4.0.12" instead? (and let us know if you see the same thing?)

PhdStudent2015 commented 6 years ago

Same error with version "4.0.12" and "4.0.0" ! My computer runs Windows 10 Entreprise.

danyaljj commented 6 years ago

Ah that might be it. Unfortunately, we're not fully compatible with Windows (yet).

FYI @danr-ccg

PhdStudent2015 commented 6 years ago

Thank you for the info. Please, add it to the Readme or to the FAQ.