-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zombiewriter crashing with an error in Classifier Reborn #5
Comments
Classifier-Reborn (the Ruby gem that ZombieWriter is dependent on) needs to do some complex matrix multiplication to perform latent semantic analysis (both for generating articles using Machine Learning and coming up with titles for news articles). There are two ways by which Classifier-Reborn does this multiplication:
Since line 309 of lsi.rb can only be accessed if Classifier-Reborn has taken Option 2, this suggests that there is a problem with the Ruby implementation of the matrix multiplication. The classifier-reborn README recommends installing GNU GSL and rb-gsl because it would "speed up LSI classification by at least 10x". As a result of this recommendation, there really hasn't been much maintenance work with the native Ruby code, and I am not good at linear algebra to personally debug the issue (nor would I want to, since GNU GSL and rb-gsl already exists and would be much more efficient than anything I could do). So my recommendation would be to follow classifier-reborn's recommendation - install GNU GSL and rb-gsl, and then try to run your script again. Classifier-Reborn should be able to detect the presence of the GSL library. When I run the script with GSL on my computer, it works perfectly (and when I disable GSL, I get the same error you did). Let me know if this solution works for you. If it does, I'll update the README to strongly recommend users install GNU GSL and rb-gsl before using this Ruby gem. |
I tried to run the software in a newly configured Ubuntu 16.04 and with a default install of Ruby 2.4 it didn't work. Same errors as in Windows: /home/masdc/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/classifier-reborn-2.1.0/lib/classifier-reborn/lsi.rb:309:in After 1 hour of research and fails i got it. I installed the following libraries, components and gems: sudo apt install linuxbrew-wrapper After that i was able to run Zombie Writer. Thanks so much for your help and guidance. GSL is a required component. I will try to do the same on the Windows machine. I read that by using Cygwin in Microsoft Windows i might be able to run GSL and hopefully Zombie Writer. |
By mandating that users install GSL on their local computers, I will prevent problems like Issue #5 from arising again. In the future, I may want to make rb-gsl a required dependency, but I want to make sure that it won't break in case someone forgots to install GSL on the local machine as well.
Hi. I was trying to use your ZombieWriter software in Windows, but unfortunately is not working.
I always get the following error:
C:/Ruby23/lib/ruby/gems/2.3.0/gems/classifier-reborn-2.1.0/lib/classifier-reborn/lsi.rb:309:in
'sort': comparison of Float with NaN failed (ArgumentError) from C:/Ruby23/lib/ruby/gems/2.3.0/gems/classifier-reborn-2.1.0/lib/classifier-reborn/lsi.rb:309:in
build_reduced_matrix'from C:/Ruby23/lib/ruby/gems/2.3.0/gems/classifier-reborn-2.1.0/lib/classifier-reborn/lsi.rb:143:in
build_index' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/classifier-reborn-2.1.0/lib/classifier-reborn/lsi/summarizer.rb:28:in
perform_lsi'from C:/Ruby23/lib/ruby/gems/2.3.0/gems/classifier-reborn-2.1.0/lib/classifier-reborn/lsi/summarizer.rb:10:in
summary' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/zombie_writer-0.2.0/lib/zombie_writer.rb:21:in
header'from C:/Ruby23/lib/ruby/gems/2.3.0/gems/zombie_writer-0.2.0/lib/zombie_writer.rb:126:in
block in generate_articles' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/zombie_writer-0.2.0/lib/zombie_writer.rb:116:in
each'from C:/Ruby23/lib/ruby/gems/2.3.0/gems/zombie_writer-0.2.0/lib/zombie_writer.rb:116:in
each_slice' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/zombie_writer-0.2.0/lib/zombie_writer.rb:116:in
with_index'from C:/Ruby23/lib/ruby/gems/2.3.0/gems/zombie_writer-0.2.0/lib/zombie_writer.rb:116:in
each' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/zombie_writer-0.2.0/lib/zombie_writer.rb:116:in
map'from C:/Ruby23/lib/ruby/gems/2.3.0/gems/zombie_writer-0.2.0/lib/zombie_writer.rb:116:in
generate_articles' from test.rb:21:in
What do you think can be the problem? Thanks so much if you can take a look.
The text was updated successfully, but these errors were encountered: