Skip to content

[Solved] OSError: stanford-chinese-corenlp-yyyy-MM-dd-models.jar not exists. You should download and place it in the models/stanford-corenlp-4.0.0/ first.

I posted [NLP][Python] How to use Stanford CoreNLP in the past and record how to use Stanford CoreNLP tool via python.

Recently, I refactored my old program but got an error message in the latest version:

OSError: stanford-chinese-corenlp-yyyy-MM-dd-models.jar not exists. You should download and place it in the models/stanford-corenlp-4.0.0/ first.

From the error message, we can see that the Chinese analysis model expected to be called by the python interface package stanfordcorenlp I used should be stanford-chinese-corenlp-yyyy-MM-dd-models.jar, but the official name has been changed when it was upgrade to 4.0.0.


Solution

First, I need to confirm there is different between the versions of Stanford CoreNLP and the python package.

To be precise, I want to confirm whether the version of the package I used has not been upgrade for the rename of the official Stanford model.

If the python package is adjusted for the new version, it may be that I have used it incorrectly.

This is the official version:

You can see the current latest version: 4.0.0 was released on 2020/04/19 after a year and a half from the previous version.

And the following is my choice of python package interface (stanfordcorenlp):

As you can see, it has not kept up with the naming of the latest official version of Stanford CoreNLP.

But I hope there is not much difference in the use of Stanford CoreNLP; with the mentality of giving it a try, I arbitrarily change the name of the model I reported wrong to:

It can be found that I even took the name indiscriminately. But unexpectedly, it can be executed normally in this way!

If you encounter this problem in use, you may be able to change the model name. However, I still look forward to the updates of the developers of the python package. After all, if the next Stanford CoreNLP has a more significant update, it may not even be possible that the model architecture has changed.

Leave a Reply