Permalink
Browse files

Merge pull request #1 from neoneye/master

Works with ruby 2.0
  • Loading branch information...
2 parents c681094 + 6d645d0 commit 76a735bf44efe25ccfbc7a0b04af80308bfaa9e2 @tiendung committed Aug 5, 2014
Showing with 76 additions and 1 deletion.
  1. +2 −0 GemFile
  2. +10 −0 Gemfile.lock
  3. +1 −1 nlp.rb
  4. +63 −0 readme.md
View
2 GemFile
@@ -0,0 +1,2 @@
+source 'https://rubygems.org'
+gem 'rjb'
View
10 Gemfile.lock
@@ -0,0 +1,10 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ rjb (1.4.9)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ rjb
View
2 nlp.rb
@@ -1,4 +1,4 @@
-require 'measure'
+require_relative 'measure'
require 'rjb'
Rjb::load('stanford-postagger.jar:stanford-ner.jar', ['-Xmx200m'])
View
63 readme.md
@@ -0,0 +1,63 @@
+# Ruby-NLP
+
+This project demoes how to use the [Stanford Pos-Tagger and Name Entity Recognizer](http://nlp.stanford.edu/software/tagger.shtml) within Ruby.
+
+## Prerequisites
+
+ prompt> ruby -v
+ ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]
+ prompt> rvm -v
+ rvm 1.25.28 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
+ prompt>
+
+
+## Install the RJB gem
+
+ prompt> bundle install
+ Fetching gem metadata from https://rubygems.org/..
+ Resolving dependencies...
+ Installing rjb 1.4.9
+ Using bundler 1.6.2
+ Your bundle is complete!
+ Use `bundle show [gemname]` to see where a bundled gem is installed.
+ prompt>
+
+
+## Run the demo app
+
+ prompt> ruby nlp.rb
+ Loading classifier from /Users/johndoe/Downloads/ruby-nlp/ner-eng-ie.crf-4-conll.ser.gz ... done [0.4 sec].
+ [ Run task 1 10 times ] Start 'NER' at 01:37:39
+ Getting data from Good afternoon Rajat Raina, how are you today? (default encoding)
+ Good/O afternoon/O Rajat/PERSON Raina/PERSON ,/O how/O are/O you/O today/O ?/O
+ Good/JJ afternoon/NN Rajat/NNP Raina,/NNP how/WRB are/VBP you/PRP today?/VB
+ Getting data from Good afternoon Rajat Raina, how are you today? (default encoding)
+ Good/O afternoon/O Rajat/PERSON Raina/PERSON ,/O how/O are/O you/O today/O ?/O
+ Good/JJ afternoon/NN Rajat/NNP Raina,/NNP how/WRB are/VBP you/PRP today?/VB
+ Getting data from Good afternoon Rajat Raina, how are you today? (default encoding)
+ Good/O afternoon/O Rajat/PERSON Raina/PERSON ,/O how/O are/O you/O today/O ?/O
+ Good/JJ afternoon/NN Rajat/NNP Raina,/NNP how/WRB are/VBP you/PRP today?/VB
+ Getting data from Good afternoon Rajat Raina, how are you today? (default encoding)
+ Good/O afternoon/O Rajat/PERSON Raina/PERSON ,/O how/O are/O you/O today/O ?/O
+ Good/JJ afternoon/NN Rajat/NNP Raina,/NNP how/WRB are/VBP you/PRP today?/VB
+ Getting data from Good afternoon Rajat Raina, how are you today? (default encoding)
+ Good/O afternoon/O Rajat/PERSON Raina/PERSON ,/O how/O are/O you/O today/O ?/O
+ Good/JJ afternoon/NN Rajat/NNP Raina,/NNP how/WRB are/VBP you/PRP today?/VB
+ Getting data from Good afternoon Rajat Raina, how are you today? (default encoding)
+ Good/O afternoon/O Rajat/PERSON Raina/PERSON ,/O how/O are/O you/O today/O ?/O
+ Good/JJ afternoon/NN Rajat/NNP Raina,/NNP how/WRB are/VBP you/PRP today?/VB
+ Getting data from Good afternoon Rajat Raina, how are you today? (default encoding)
+ Good/O afternoon/O Rajat/PERSON Raina/PERSON ,/O how/O are/O you/O today/O ?/O
+ Good/JJ afternoon/NN Rajat/NNP Raina,/NNP how/WRB are/VBP you/PRP today?/VB
+ Getting data from Good afternoon Rajat Raina, how are you today? (default encoding)
+ Good/O afternoon/O Rajat/PERSON Raina/PERSON ,/O how/O are/O you/O today/O ?/O
+ Good/JJ afternoon/NN Rajat/NNP Raina,/NNP how/WRB are/VBP you/PRP today?/VB
+ Getting data from Good afternoon Rajat Raina, how are you today? (default encoding)
+ Good/O afternoon/O Rajat/PERSON Raina/PERSON ,/O how/O are/O you/O today/O ?/O
+ Good/JJ afternoon/NN Rajat/NNP Raina,/NNP how/WRB are/VBP you/PRP today?/VB
+ Getting data from Good afternoon Rajat Raina, how are you today? (default encoding)
+ Good/O afternoon/O Rajat/PERSON Raina/PERSON ,/O how/O are/O you/O today/O ?/O
+ Good/JJ afternoon/NN Rajat/NNP Raina,/NNP how/WRB are/VBP you/PRP today?/VB
+ [ Run task 1 10 times ] Spent 0 seconds on 'NER'
+ prompt>
+

0 comments on commit 76a735b

Please sign in to comment.