0
votes

I am trying to get the Parts of Speech of few sentences, for this I am using stanford NLP POS tagger english-left3words-distsim.tagger

the code

but while I am trying to initialize this model I am getting error:

java.io.InvalidClassException,local class incompatible: stream classdesc serialVersionUID = 2, local class serialVersionUID = 1

Initially I thought this is due to improper jars, but I got the jars from nlp.stanford.edu site only. I dont understand why I am getting this error.

1
apparently the problem is somewhere else in the code. Could you post complete stacktrace that includes the information about the line of code that causes the exception? Also Can you confirm that the location of english-left3words-distsim.tagger is accesible by your program during runtime? If possible please also put your complete code somewhere online so others can help to review it - Yohanes Gultom
Thanks @YohanesGultom,the error was with the NLP jar .Yes, the tagger is accessible during runtime. - Sid

1 Answers

2
votes

Make sure you download the latest version of Stanford CoreNLP 3.7.0 and use the latest model jars that correspond to 3.7.0. The error you are getting suggests you are trying to use models which are not compatible with the version of Stanford CoreNLP you are running.