0

I am looking to load a custom build NER model as well as one of the "out-of-box" Stanford CoreNLP NER models on a Windows 10 computer. I would like to apply both models to my text.

I have accomplished this for a CentOS system and authored this question "Load Custom NER Model Stanford CoreNLP".

I understand that I can use -serverproperties with a properties file to load a custom NER model. When you do this that is the only model to load and you would have to specify which "out-of-box" NER models you would like to load in addition to your custom model. I have done this on my CentOS system but cannot accomplish it on my Windows computer.

The difficulty comes in specifying the filepath to the "out-of-box" NER models. I use this type of path for my custom model C:\path\to\custom_model.ser.gz but I do not have a file path to the "out-of-box" NER models as their paths are for a Linux OS.

How do I properly direct CoreNLP to the "out-of-box" NER models in my server.prop file?

Fraizier Reiland
  • 147
  • 1
  • 11

2 Answers2

0

The ner.model file path can take in a comma separated list with multiple model paths. I honestly am not familiar with Windows, so I am not really sure what would happen if you supplied a DOS style path in your list for ner.model .

But assuming that doesn't work, you could always make a jar and place your custom model in that jar with a Unix path, then place that jar into your CLASSPATH when running your application.

StanfordNLPHelp
  • 8,699
  • 1
  • 11
  • 9
  • Hmm, reading your post more clearly, I would assume if you are running your application, that you can use the Unix style path and it should find it in the included jars. I am not very familiar with Windows though, so not sure if there are complications I am unaware of. – StanfordNLPHelp Aug 31 '17 at 00:39
0

I was able to solve my own problem. This is what I used in the server.prop file:

ner.model = C:\\path\\to\\custom_model.ser.gz,edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz

The issue I was having was that I was putting a space after the comma separating the models. I would get the "Unable to load as url, path, or file" error because it was adding the space to the file path. ~face to palm~

Fraizier Reiland
  • 147
  • 1
  • 11