Skip to content

tamaloa/stanford_nlp_ruby_wrapper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stanford NLP Ruby Wrapper

This is a very thin wrapper around some basic commands which show how to use some of the excellent stanford nlp libraries inside a ruby project. This is done by using Ruby Java Bridge. The tests give a first impression on what to expect from the included Part-of-speech tagger (postagger) and Named Entity Recognizer (NER).

Installation

The gem is not published as a rubygem as it is insanely big (it contains the necessary java libraries and classifier/models in the bin directory) – sorry github.
For a quick tryout you can include it in your ruby or rails project using bundler and adding

gem 'stanford_nlp_ruby_wrapper', :git => 'git://github.com/tamaloa/stanford_nlp_ruby_wrapper'

to your Gemfile.
To really use a part of stanford nlp in your project you will want to include the libraries directly and write your own wrapper if needed at all.

Usage

Using postagger:


tagger = StanfordNlpRubyWrapper::PartOfSpeechTagger.new
tagger.tag_sentence(“Good afternoon Rajat Raina, how are you today?”)
=> "Good/JJ afternoon/NN Rajat/NNP Raina/NNP ,/, how/WRB are/VBP you/PRP today/NN ?/. "

Using ner:


ner = StanfordNlpRubyWrapper::NamedEntityRecognizer.new
ner.classify(“Good afternoon Rajat Raina, how are you today?”)
=> “Good afternoon Rajat Raina, how are you today?”

License

As including the stanford nlp libraries for POS-tagging and NER this code is also licensed as GPL-2 (see LICENSE file). For Copyright and further information on stanford nlp see the included files in bin/ or the stanford nlp website

About

Ruby Binding for Stanford Pos-Tagger and Name Entity Recognizer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 46.7%
  • Java 45.6%
  • Shell 7.7%