Closed profmaad closed 12 years ago
Thanks for this report.
Short answer:
gem install stanford-core-nlp
And download either:
The JAR files should be placed under /bin/stanford/
, and the model files under /models/stanford/
(inside the Treat gem folder).
You can also check out the manual install page from the wiki for more info.
Long answer: This "installer" thing has already given me a lot of trouble and seems like it wants to give me still more. The problem is that I just can't ask the user to install all of the ~50 gems that the library can potentially use, that would be complete overkill. This is a dilemma I have been facing from the start of this project and I'd be happy to know if there are any existing libraries that have found a nicer way to manage optional dependencies. Another possibility is to just let the user figure out which libraries to install on his/her own, by throwing helpful error messages, which is what I think I'll be moving toward in v. 2.0 (which I plan on releasing maybe in about a month). I'll just keep the installer as a download script to install the Stanford files.
Thanks for the quick reply.
I did install the gem as proposed and installed all the english models locally in /home/profmaad/.gem/ruby/1.9.1/gems/treat-1.0.6/
. treat seems to find the JARs as well as the models, but complains about missing property files:
irb(main):001:0> require 'treat'
=> true
irb(main):002:0> "some text here".parse
RuntimeIOException: ERROR: cannot find properties file "{pos.model=/home/profmaad/.gem/ruby/1.9.1/gems/treat-1.0.6/models/stanford/taggers/english-left3words-distsim.tagger, parser.model=/home/profmaad/.gem/ruby/1.9.1/gems/treat-1.0.6/models/stanford/grammar/englishPCFG.ser.gz, annotators=tokenize, ssplit, pos, lemma, parse}" in the classpath!
from /usr/lib/ruby/gems/1.9.1/gems/stanford-core-nlp-0.3.2/lib/stanford-core-nlp.rb:148:in `new'
from /usr/lib/ruby/gems/1.9.1/gems/stanford-core-nlp-0.3.2/lib/stanford-core-nlp.rb:148:in `load'
from /home/profmaad/.gem/ruby/1.9.1/gems/treat-1.0.6/lib/treat/processors/parsers/stanford.rb:77:in `init'
from /home/profmaad/.gem/ruby/1.9.1/gems/treat-1.0.6/lib/treat/processors/parsers/stanford.rb:28:in `parse'
from /home/profmaad/.gem/ruby/1.9.1/gems/treat-1.0.6/lib/treat/entities/abilities/delegatable.rb:69:in `call_worker'
from /home/profmaad/.gem/ruby/1.9.1/gems/treat-1.0.6/lib/treat/entities/abilities/delegatable.rb:39:in `block (2 levels) in add_workers'
from /home/profmaad/.gem/ruby/1.9.1/gems/treat-1.0.6/lib/treat/proxies.rb:14:in `method_missing'
from (irb):2
from /usr/bin/irb:12:in `<main>'
There is a .gem/ruby/1.9.1/gems/treat-1.0.6/models/stanford/taggers/english-left3words-distsim.tagger.props
, though.
First thing that comes to mind here is your Ruby version: are you running 1.9.1 or just storing your gems in there? Treat should not even let you run on 1.9.1 without throwing an exception, so I assume it is the latter (?) If you are running 1.9.1, you should probably update to 1.9.2 or 1.9.3 to run Treat, since they are the the two versions I develop and test on.
Otherwise, I just did a fresh install of treat-1.0.6 and stanford-core-nlp-0.3.2 and your example works as expected here (OS X, Ruby 1.9.2). I'll need your help debugging here... I'll try on my Ubuntu box later to see if this is a non-Mac issue.
Ok, just tried on a clean install as well, and that works. So I guess its something about my failed Installer tries on my other machine. Guess this is closed then.
Happy to know this worked out, and don't hesitate if you encounter any other unexpected stuff.
Hi there,
I just tried installing treat on Arch linux and basically was completely unable to get it to work. As my normal user, I did
gem install treat
, which worked as expected. If I then doTreat.install
inside IRB, I get the following error:The installer shouldn't try to install those files in
/usr
, after all the gem resides in~/.gem
.If I do the same thing as root, the gem gets installed in
/root/.gem
, the install procedure works. But afterwords I am unable to use treat as a normal user, because it was installed into `/root/.gem'. Installing the gem as my user as well didn't work either, following error:So the installer installs system-wide, but the gem then looks locally for the files.
Please fix this, I am completely unable to use treat because of this. It seems to me that the installer should be installing where the gem is located.