louismullie / stanford-core-nlp

Ruby bindings to the Stanford Core NLP tools (English, French, German).
Other
432 stars 70 forks source link

annotator path problem on windows install #3

Closed nicboudreau closed 12 years ago

nicboudreau commented 12 years ago

I am running Ruby 1.9.3 under Windows and I am getting the following error when using the following line of code:

The first part (at least) seems like the path is using /'s instead of .'s ?

code:

pipeline = StanfordCoreNLP.load(:tokenize, :ssplit, :lemma, :parse, :ner)

error:

Searching for resource: {ner/model/MISCclass=C:/Ruby193/lib/ruby/gems/1/9/1/gems/stanford-core-nlp-0 /2/1/lib////bin/classifiers/conll/4class/distsim/crf/ser/gz, ner/model/3class=C:/Ruby193/lib/ruby/ge ms/1/9/1/gems/stanford-core-nlp-0/2/1/lib////bin/classifiers/all/3class/distsim/crf/ser/gz, parser/m odel=C:/Ruby193/lib/ruby/gems/1/9/1/gems/stanford-core-nlp-0/2/1/lib////bin/grammar/englishPCFG/ser/ gz, ner/model/7class=C:/Ruby193/lib/ruby/gems/1/9/1/gems/stanford-core-nlp-0/2/1/lib////bin/classifi ers/muc/7class/distsim/crf/ser/gz, annotators=tokenize, ssplit, lemma, parse, ner}.properties C:/Ruby193/lib/ruby/gems/1.9.1/gems/stanford-core-nlp-0.2.1/lib/stanford-core-nlp.rb:152:in `new': E RROR: cannot find properties file "{ner.model.MISCclass=C:/Ruby193/lib/ruby/gems/1.9.1/gems/stanford -core-nlp-0.2.1/lib/../bin/classifiers/conll.4class.distsim.crf.ser.gz, ner.model.3class=C:/Ruby193/ lib/ruby/gems/1.9.1/gems/stanford-core-nlp-0.2.1/lib/../bin/classifiers/all.3class.distsim.crf.ser.g z, parser.model=C:/Ruby193/lib/ruby/gems/1.9.1/gems/stanford-core-nlp-0.2.1/lib/../bin/grammar/engli shPCFG.ser.gz, ner.model.7class=C:/Ruby193/lib/ruby/gems/1.9.1/gems/stanford-core-nlp-0.2.1/lib/../b in/classifiers/muc.7class.distsim.crf.ser.gz, annotators=tokenize, ssplit, lemma, parse, ner}" in the classpath! (RuntimeException)

from C:/Ruby193/lib/ruby/gems/1.9.1/gems/stanford-core-nlp-0.2.1/lib/stanford-core-nlp.rb:152:in `load'

from ruby_ner.rb:26:in `

'

louismullie commented 12 years ago

Hi Nic,

I just committed a patch that should add support for backslash-style paths. This should also fix the problem with the /'s instead of .'s. Let me know if this works for you:

git clone git@github.com:louismullie/stanford-core-nlp.git
cd stanford-core-nlp
bundle install
[copy the files to the /bin folder]
rake test

Cheers, Louis

nicboudreau commented 12 years ago

Hi Louie,

It looks like the filenames are using / instead of .

Searching for resource: {ner/model/MISCclass=C:/Ruby193/lib/ruby/gems/1/9/1/gems/stanford-core-nlp-0 /3/0/lib////bin/classifiers/conll/4class/distsim/crf/ser/gz, ner/model/3class=C:/Ruby193/lib/ruby/ge ms/1/9/1/gems/stanford-core-nlp-0/3/0/lib////bin/classifiers/all/3class/distsim/crf/ser/gz, parser/m odel=C:/Ruby193/lib/ruby/gems/1/9/1/gems/stanford-core-nlp-0/3/0/lib////bin/grammar/englishPCFG/ser/ gz, ner/model/7class=C:/Ruby193/lib/ruby/gems/1/9/1/gems/stanford-core-nlp-0/3/0/lib////bin/classifi ers/muc/7class/distsim/crf/ser/gz, annotators=tokenize, ssplit, lemma, parse, ner}.properties C:/Ruby193/lib/ruby/gems/1.9.1/gems/stanford-core-nlp-0.3.0/lib/stanford-core-nlp.rb:124:in new': E RROR: cannot find properties file "{ner.model.MISCclass=C:/Ruby193/lib/ruby/gems/1.9.1/gems/stanford -core-nlp-0.3.0/lib/../bin/classifiers/conll.4class.distsim.crf.ser.gz, ner.model.3class=C:/Ruby193/ lib/ruby/gems/1.9.1/gems/stanford-core-nlp-0.3.0/lib/../bin/classifiers/all.3class.distsim.crf.ser.g z, parser.model=C:/Ruby193/lib/ruby/gems/1.9.1/gems/stanford-core-nlp-0.3.0/lib/../bin/grammar/engli shPCFG.ser.gz, ner.model.7class=C:/Ruby193/lib/ruby/gems/1.9.1/gems/stanford-core-nlp-0.3.0/lib/../b in/classifiers/muc.7class.distsim.crf.ser.gz, annotators=tokenize, ssplit, lemma, parse, ner}" in th e classpath! (RuntimeException) from C:/Ruby193/lib/ruby/gems/1.9.1/gems/stanford-core-nlp-0.3.0/lib/stanford-core-nlp.rb:12 4:inload' from ruby_ner.rb:26:in `

'

nicboudreau commented 12 years ago

...but maybe I am doing something wrong? I uninstalled the gem and reinstalled so that I was up to 3.0

nicboudreau commented 12 years ago

i am being stupid/lazy, trying your instructions now. Thanks!

louismullie commented 12 years ago

Did it work for you?

nicboudreau commented 12 years ago

Thanks for checking in. I didn't get it to work. Seems like the same issues? "unigrams/txt" etc..

Searching for resource: {dcoref/female=C:/Documents and Settings/boss/Desktop/rubes/stanford-core-nl p/bin/dcoref/female/unigrams/txt, dcoref/countries=C:/Documents and Settings/boss/Desktop/rubes/stan ford-core-nlp/bin/dcoref/unknown/txt, dcoref/animate=C:/Documents and Settings/boss/Desktop/rubes/st anford-core-nlp/bin/dcoref/animate/unigrams/txt, dcoref/plural=C:/Documents and Settings/boss/Deskto p/rubes/stanford-core-nlp/bin/dcoref/plural/unigrams/txt, pos/model=C:/Documents and Settings/boss/D esktop/rubes/stanford-core-nlp/bin/taggers/english-left3words-distsim/tagger, ner/model/7class=C:/Do cuments and Settings/boss/Desktop/rubes/stanford-core-nlp/bin/classifiers/muc/7class/distsim/crf/ser /gz, dcoref/male=C:/Documents and Settings/boss/Desktop/rubes/stanford-core-nlp/bin/dcoref/male/unig rams/txt, annotators=tokenize, ssplit, pos, lemma, parse, ner, dcoref, dcoref/singular=C:/Documents and Settings/boss/Desktop/rubes/stanford-core-nlp/bin/dcoref/singular/unigrams/txt, dcoref/states/pr ovinces=C:/Documents and Settings/boss/Desktop/rubes/stanford-core-nlp/bin/dcoref/unknown/txt, dcore f/inanimate=C:/Documents and Settings/boss/Desktop/rubes/stanford-core-nlp/bin/dcoref/inanimate/unig rams/txt, dcoref/demonym=C:/Documents and Settings/boss/Desktop/rubes/stanford-core-nlp/bin/dcoref/d emonyms/txt, ner/model/3class=C:/Documents and Settings/boss/Desktop/rubes/stanford-core-nlp/bin/cla ssifiers/all/3class/distsim/crf/ser/gz, dcoref/extra/gender=C:/Documents and Settings/boss/Desktop/r ubes/stanford-core-nlp/bin/dcoref/namegender/combine/txt, ner/model/MISCclass=C:/Documents and Setti ngs/boss/Desktop/rubes/stanford-core-nlp/bin/classifiers/conll/4class/distsim/crf/ser/gz, dcoref/neu tral=C:/Documents and Settings/boss/Desktop/rubes/stanford-core-nlp/bin/dcoref/neutral/unigrams/txt, parser/model=C:/Documents and Settings/boss/Desktop/rubes/stanford-core-nlp/bin/grammar/englishPCFG /ser/gz, dcoref/states=C:/Documents and Settings/boss/Desktop/rubes/stanford-core-nlp/bin/dcoref/sta te-abbreviations/txt}.properties

Did it work for you?


Reply to this email directly or view it on GitHub: https://github.com/louismullie/stanford-core-nlp/issues/3#issuecomment-5708052

louismullie commented 12 years ago

Sorry, I don't have a Windows machine to debug on, so it's a bit hard for me to help you. Since I've gotten a recent report of the gem working on Windows, I'll keep this closed this unless you can debug it and find where this fails.