Skip to content

java.io.IOException: Unable to open "edu/stanford/nlp/models/pos-tagger/english-left3words-distsim.tagger" as class path, filename or URL #1309

@jakoboo1

Description

@jakoboo1

Hi everyone,

I wanted to get started with the StanfordCorenlp library in Java. I added the library with the correct dependencies to the project. After that I wrote a simple program that should display the sentiment of a couple of sentences. I made two classes: Pipeline and SentimentAnalysis

Pipeline class:
image

SentimentAnalysis class:
image

When i run this code i get the following error.

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" edu.stanford.nlp.io.RuntimeIOException: Error while loading a tagger model (probably missing model file)
at stanford.corenlp@4.4.0/edu.stanford.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:798)
at stanford.corenlp@4.4.0/edu.stanford.nlp.tagger.maxent.MaxentTagger.(MaxentTagger.java:322)
at stanford.corenlp@4.4.0/edu.stanford.nlp.tagger.maxent.MaxentTagger.(MaxentTagger.java:275)
at stanford.corenlp@4.4.0/edu.stanford.nlp.pipeline.POSTaggerAnnotator.loadModel(POSTaggerAnnotator.java:85)
at stanford.corenlp@4.4.0/edu.stanford.nlp.pipeline.POSTaggerAnnotator.(POSTaggerAnnotator.java:73)
at stanford.corenlp@4.4.0/edu.stanford.nlp.pipeline.AnnotatorImplementations.posTagger(AnnotatorImplementations.java:75)
at stanford.corenlp@4.4.0/edu.stanford.nlp.pipeline.StanfordCoreNLP.lambda$getNamedAnnotators$6(StanfordCoreNLP.java:566)
at stanford.corenlp@4.4.0/edu.stanford.nlp.pipeline.StanfordCoreNLP.lambda$constructAnnotatorPool$33(StanfordCoreNLP.java:647)
at stanford.corenlp@4.4.0/edu.stanford.nlp.util.Lazy$3.compute(Lazy.java:126)
at stanford.corenlp@4.4.0/edu.stanford.nlp.util.Lazy.get(Lazy.java:31)
at stanford.corenlp@4.4.0/edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:149)
at stanford.corenlp@4.4.0/edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:278)
at stanford.corenlp@4.4.0/edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:194)
at stanford.corenlp@4.4.0/edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:190)
at com.example.oefenenstanford/com.example.oefenenstanford.Pipeline.getPipeline(Pipeline.java:22)
at com.example.oefenenstanford/com.example.oefenenstanford.SentimentAnlysis.main(SentimentAnlysis.java:13)
Caused by: java.io.IOException: Unable to open "edu/stanford/nlp/models/pos-tagger/english-left3words-distsim.tagger" as class path, filename or URL
at stanford.corenlp@4.4.0/edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSystem(IOUtils.java:501)
at stanford.corenlp@4.4.0/edu.stanford.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:795)

I have no idea what is causing this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions