Code Monkey home page Code Monkey logo

machinereading-ruby's Introduction

Ruby Gem Icon MachineReading Ruby Gem

Code Climate Travis CI Gem Version Coverage Status

Ruby gem for interaction with Damantic's MachineReading APIs.

Installation

Add this line to your application's Gemfile:

gem 'machinereading'

And then execute:

$ bundle install

Setup

Setup configuration parameters

Machinereading.configure do |c|
  c.api_key = "your-api-key-from-machine-reading-account"
  c.endpoint = "http://www.machinereading.com"
end

Usage

Methods references are taken from Machine Reading documentation.

Tokenizer: divides text into a sequence of sentences and tokens, which roughly correspond to "words".

element = Machinereading::Element.new("Questo è un testo di esempio", "it")
response = element.tokenizer

Pos Tagger Stanford: assigns a part of speech (POS) tags to each word of the input text. Tags are mostly language independent following the Penn Treebank tag set.

element = Machinereading::Element.new("Questo è un testo di esempio", "it")
response = element.pos_tagger_stanford # default is "vertical""
response = element.pos_tagger_stanford("horizontal")

Syntactic Parser Stanford: takes natural language sentences in input and returns a full dependency tree describing its syntactic structure. The grammatical relations are mostly language independent.

element = Machinereading::Element.new("Questo è un testo di esempio", "it")
response = element.syntactic_parser_stanford

Lemmatizer: is used to parse the input text and provides the lemmas for each word.

element = Machinereading::Element.new("Questo è un testo di esempio", "it")
response = element.lemmatizer

Sequence Surprisal: assigns a "surprisal value" (probabilities range from 0 to 1) to each word and each sentence of the input text. Surprisal captures a range of sentence processing effects like syntactic difficulties.

element = Machinereading::Element.new("Questo è un testo di esempio", "it")
response = element.sequence_surprisal

Language Detector: determines the language that any text content was written in.

element = Machinereading::Element.new("Questo è un testo di esempio", nil)
response = element.language_detector

Keyword Extractor: analyzes the input text and extracts the most important words and phrases (proper nouns and common nouns).

element = Machinereading::Element.new("Questo è un testo di esempio", "it")
response = element.keyword_extractor # default is 15
response = element.keyword_extractor(50)

Automatic Categorization: auto-categorizes and organizes huge sets of text into relevant categories (IPTC) based on automatically detected themes and content.

element = Machinereading::Element.new("Questo è un testo di esempio", "it")
response = element.automatic_categorization

Voice Tags: extracts additional information about the meaning of the text. It can be identifies when there are values in the text as "adversative", "hypothesis", "reason or cause". Voice Tags also extracts positive and negative words of the input text as a starting point for building your own sentiment analysis system.

element = Machinereading::Element.new("Questo è un testo di esempio", "it")
response = element.voice_tags

machinereading-ruby's People

Contributors

zenkay avatar

Watchers

 avatar

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.