Closed bckwon83 closed 11 years ago
Hi,
I'm also getting the same message.
1.9.3-p125 :332 > doc = Document('/tmp/document.txt') => Document (70334188576300) --- "NORWICH DEVELOPMENT REVIEW [...] Dechert, Clerk" --- {:file=>"/tmp/document.txt", :format=>"txt"} --- []
1.9.3-p125 :333 > doc.do :chunk, :segment, :tokenize, :keywords Treat::Exception: No tf_idf is/are available for the English language.
It looks like the files downloaded using 'gem install treat' are stale
replace the following files in your gem directory from the github repo.
lib\treat\config\data\languages\agnostic.rb lib\treat\config\data\languages\english.rb lib\treat\workers\extractors\tf_idf\native.rb
Yup, that should be the main problem. Although I can't guarantee everything to be compatible, since there was a major update to the configuration files since the last gem release. Thinks are looking good for me to publish the next version of the gem around this week-end, so stay tuned for that.
Fixed in the master branch.
Hello,
First of all, thank you so much for creating this awesome gem. I have one issue while using this gem. I have trouble getting keywords out of collection. I just used the sample code you provided in the tutorial:
c = Collection('economist') c.do(:chunk, :segment, :tokenize, :keywords)
I have installed tf_idf gem manually and it is in place. However, I still get this weird error:
Treat::Exception: No tf_idf is/are available for the English language. from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/delegatable.rb:112:in
find_worker_for_language' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/delegatable.rb:85:in
find_worker' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/delegatable.rb:57:incall_worker' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/delegatable.rb:42:in
block (2 levels) in add_workers' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/workers/extractors/keywords/tf_idf.rb:20:inblock in keywords' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/magical.rb:45:in
block in magic' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/iterable.rb:22:inblock (2 levels) in each_entity' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/iterable.rb:22:in
block (2 levels) in each_entity' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/iterable.rb:22:inblock (2 levels) in each_entity' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/iterable.rb:18:in
each_entity' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/iterable.rb:22:inblock in each_entity' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/iterable.rb:21:in
each' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/iterable.rb:21:ineach_entity' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/iterable.rb:22:in
block in each_entity' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/iterable.rb:21:ineach' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/iterable.rb:21:in
each_entity' ... 5 levels... from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/workers/extractors/keywords/tf_idf.rb:19:inkeywords' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/delegatable.rb:68:in
call_worker' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/delegatable.rb:42:inblock (2 levels) in add_workers' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/doable.rb:39:in
do_task' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/doable.rb:47:inblock in do_task' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/doable.rb:46:in
each' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/doable.rb:46:indo_task' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/doable.rb:22:in
block in do' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/doable.rb:6:ineach' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/treat-1.2.0/lib/treat/entities/abilities/doable.rb:6:in
do' from (irb):2 from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.6/lib/rails/commands/console.rb:47:instart' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.6/lib/rails/commands/console.rb:8:in
start' from /Users/kwonb/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.6/lib/rails/commands.rb:41:in<top (required)>' from script/rails:6:in
require' from script/railsSorry, I might be throwing a too basic question, but this problem cannot be solved by myself.. is there some additional steps I need to do?