Giter Club home page Giter Club logo

alchemy-api-rb's Introduction

AlchemyAPI

Build Status Code Climate Coverage Status Dependency Status Gem Version

This is a Ruby Client Library that provides access to the Alchemy text mining API. The current version targets the following API's:

  • Author Extraction
  • Combined Call
  • Concept Tagging
  • Entity Extraction
  • Face Detection/Recognition
  • Image Tagging
  • Keyword Extraction
  • Language Detection
  • Relation Extraction
  • Sentiment Analysis
  • Targeted Sentiment Analysis
  • Taxonomy
  • Text Categorization
  • Text Extraction
  • Title Extraction

Not yet implemented API's:

  • Content Scraping
  • Microformats
  • RSS / ATOM

Installation

Add this line to your application's Gemfile:

gem 'alchemy-api-rb', :require => 'alchemy_api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install alchemy-api-rb

Usage

You'll need to request an API Key.

Set your API Key in an initializer or something similar:

AlchemyAPI.key = "xxxxxxxxxxxxxxxxxx"

You may set the key along with other config settings:

AlchemyAPI.configure do |config|
  config.apikey = "xxxxxxxxxxxxxxxxxx"
  config.output_mode = :xml # not yet supported
end

Request keyword extraction for a string of text:

results = AlchemyAPI.search(:keyword_extraction, text: "hello world")

or

results = AlchemyAPI::KeywordExtraction.new.search(url: 'http://www.alchemyapi.com/')

or

results = AlchemyAPI::KeywordExtraction.new.search(html: "<html><body>lorem ipsum</body></html>")

Results for keyword extraction are returned as a array of keywords:

[
  {
         "text" => 'lorem ipsum',
    "relevance" => "0.993164"
  }
]

Testing

The specs are expecting your API Key as an environment variable named ALCHEMY_API_KEY. You can export it locally or prepend the test command like so:

ALCHEMY_API_KEY="this-is-my-40-character-key" bundle exec rake test

If you would like to expirement with the API you can run the console rake task and use the commands above to set the API Key issue search commands:

bundle exec rake console

TODO

  1. Add missing Alchmey API search modes
  2. Add support for raw output (JSON, XML and RDF)?

Contributing

alchemy-api-rb is work of several contributors. You're encouraged to submit pull requests, propose features and discuss issues.

See CONTRIBUTING.

License

MIT License. See LICENSE for details.

alchemy-api-rb's People

Contributors

johnallen3d avatar jsullivan avatar leviwilson avatar aaronkalair avatar adamferguson avatar fdeschenes avatar hayesgm avatar jackross avatar manuelmeurer avatar reshleman avatar vanderhoop avatar vaibhao90 avatar

Watchers

James Cloos avatar Michael Kurtikov 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.