Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
PhdStudent2015 opened this issue Sep 24, 2018 · 4 comments
Open

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

PhdStudent2015 opened this issue Sep 24, 2018 · 4 comments

Comments

@PhdStudent2015
Copy link

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)

@danyaljj
Copy link
Member

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

@PhdStudent2015
Copy link
Author

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

@danyaljj
Copy link
Member

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

FYI @danr-ccg

@PhdStudent2015
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants