Giter Site home page Giter Site logo

bind-it's People

Contributors

louismullie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bind-it's Issues

Issue when several bind-it modules are used in the same time

I have several modules using bind-it (opennlp and self-made module).
For the options like log_file or jvm_args the first module to load is the only one to work.
So the logs of differents modules go in the same file
and I need set options like -Xmx2G knowing how many modules I will load

jar_loader.rb:45:in `load': wrong argument type nil

Very odd issue here. I used bind-it to load stanford-nlp-core for a 48-hour hackathon and had no problems. A day later, I went to load the project and received this error:

/Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:45:in `load': wrong argument type nil (expected String) (TypeError)
  from /Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:45:in `init_rjb'
  from /Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:38:in `load_jar_rjb'
  from /Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:27:in `load'
  from /Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/binding.rb:63:in `load_jar'
  from /Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/binding.rb:71:in `block in load_default_jars'
  from /Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/binding.rb:68:in `each'
  from /Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/binding.rb:68:in `load_default_jars'
  from /Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/binding.rb:55:in `bind'
  from /Users/username/.rvm/gems/ruby-2.1.3/gems/stanford-core-nlp-0.5.1/lib/stanford-core-nlp.rb:125:in `bind'
  from /Users/username/.rvm/gems/ruby-2.1.3/gems/stanford-core-nlp-0.5.1/lib/stanford-core-nlp.rb:140:in `load'
  from ./bin/job_runner:41:in `<main>'

I'm pretty perplexed here. Is this an Rjb error? Tried forcing Rjb to 1.5.1, 1.4.9, 1.4.3, no change.

/dev/null in Windows

Running Treat on Windows output an error from this line:

puts sect.do(:chunk, :segment, :tokenize, :parse)
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:64:in `new': \dev\null (The system cannot find the path specified) (FileNotFoundException)
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:64:in `set_java_logging'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:46:in `init_rjb'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:38:in `load_jar_rjb'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:27:in `load'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/binding.rb:63:in `load_jar'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/binding.rb:71:in `block in load_default_jars'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/binding.rb:68:in `each'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/binding.rb:68:in `load_default_jars'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/binding.rb:55:in `bind'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/stanford-core-nlp-0.5.1/lib/stanford-core-nlp.rb:125:in `bind'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/loaders/bind_it.rb:42:in `load'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/loaders/stanford.rb:8:in `load'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/workers/processors/parsers/stanford.rb:24:in `parse'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/delegatable.rb:66:in `call_worker'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/delegatable.rb:40:in `block (2 levels) in add_workers'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:41:in `do_task'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:49:in `block in do_task'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:48:in `each'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:48:in `do_task'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:49:in `block in do_task'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:48:in `each'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:48:in `do_task'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:49:in `block in do_task'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:48:in `each'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:48:in `do_task'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:22:in `block in apply'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:6:in `each'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:6:in `apply'
    from treat.rb:25:in `<main>'

I think this is because the Windows version of /dev/null is NIL. The following line fixed it, in jar_loader.rb between lines 60 and 61:

if self.log_file == '/dev/null' and Gem.win_platform?
  self.log_file = 'NIL'
end

I'm still a Ruby newbie, so I didn't want to submit a pull request. There's probably a better way of doing this, but the above works for my setup.

Performance issue in method_missing

The patching of method_missing here:

def method_missing(sym, *args, &block)

leads to an order of magnitude slowdown when using the stanford core nlp gem. As a quick benchmark, without this code, I can get tokens at a rate roughly of 2.5/s, with that code, it drops to 0.4/s.

What was the scenario that led to having to patch that code? Are there scenarios where it's safe to remove?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.