0
votes

I am working on a project in c# and I have to integrate stanford pos-tagger API although I have done it but when I compile my code I get an error

An exception of type 'edu.stanford.nlp.io.RuntimeIOException' occurred in stanford-postagger-3.6.0.dll but was not handled in user code

Additional information: Error while loading a tagger model (probably missing model file)

The line on which this error is pointing in my code is this:

var tagger = new MaxentTagger(@"..\..\..\..\paket-files\nlp.stanford.edu\stanford-postagger-full-2015-12-09\models\wsj-0-18-bidirectional-distsim.tagger");

Note: How I installed pos-tagger is by right clicking on my Solution then "manage nuget.org packages" and searched for stanford nlp tagger and installed it I have copied code from here : https://sergey-tihon.github.io/Stanford.NLP.NET/StanfordPOSTagger.html

1

1 Answers

1
votes

95% chance that you're missing the CoreNLP models jar from your classpath. You need to include not only the code jar, but also the models jar; both included in the standard distribution. For example, in Maven, you'd need:

<dependencies>
<dependency>
    <groupId>edu.stanford.nlp</groupId>
    <artifactId>stanford-corenlp</artifactId>
    <version>3.6.0</version>
</dependency>
<dependency>
    <groupId>edu.stanford.nlp</groupId>
    <artifactId>stanford-corenlp</artifactId>
    <version>3.6.0</version>
    <classifier>models</classifier>
</dependency>
</dependencies>

(The top entry is the code, the bottom entry is the models).