TextRazor

TextRazor gem implements the TextRazor API for easy natural language processing of unstructed text. For more info about the API visit their website at textrazor.com.

Installation

Add this line to your application's Gemfile:

gem 'text_razor'

And then execute:

$ bundle

Or install it yourself as:

$ gem install text_razor

Usage

Usage is pretty simple but pretty limited at the moment as not all features of the API are supported.

Start by initializing a new TextRazor object like this:

tr = TextRazor.new(api_key: '123456', text: 'This should be a huge body of text that you really really really want to process', extractors: 'entities')

Note that you are passing in a hash of three things: your API key from textrazor.com, the text you want to process, and the extractors you want to use. At the moment only entities, topics, coarse topics, and words are supported.

Once you initialize your object, call #process on it to get your data from the API:

tr.process # calls the api
tr.entities # returns all of the entities
tr.topics # returns all of the topics
tr.coarse_topics # returns all of the coarse topics
tr.words # returns all of the words

For more information on the data getting returned for those extractors, visit the documentation at http://www.textrazor.com/documentation_rest