cogcomp-nlp
cogcomp-nlp copied to clipboard
Error "Attempted to access negative index of FVector.!
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
<dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <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)
Sorry for the inconvenience. Can you try the version "4.0.12" instead? (and let us know if you see the same thing?)
Same error with version "4.0.12" and "4.0.0" ! My computer runs Windows 10 Entreprise.
Ah that might be it. Unfortunately, we're not fully compatible with Windows (yet).
FYI @danr-ccg
Thank you for the info. Please, add it to the Readme or to the FAQ.