Skip to content

Ruby Gem for Dandelion API, Semantic Text Analytics as a service

License

Notifications You must be signed in to change notification settings

Smithaaaa/dandelionapi-ruby

Repository files navigation

Ruby Gem Icon Dandelion API Ruby Gem

Code Climate Travis CI Gem Version Coverage Status

Installation

Add this line to your application's Gemfile:

gem 'dandelionapi'

And then execute:

$ bundle install

Setup

Setup configuration parameters

Dandelionapi.configure do |c|
  c.app_id = "your-app-id-for-dandelionapi-account"
  c.app_key = "your-app-key-for-dandelionapi-account"
  c.endpoint = "https://api.dandelion.eu/"
end

Usage

Methods references are taken from Dandelion API's documentation.

Entity Extraction API: is a named entity extraction & linking API that performs very well even on short texts, on which many other similar services do not. dataTXT-NEX currently works on English, French, German, Italian and Portuguese texts. With this API you will be able to automatically tag your texts, extracting Wikipedia entities and enriching your data.

element = Dandelionapi::EntityExtraction.new
response = element.analyze(text: "This is a test")

Text Similarity API: is a semantic sentence similarity API optimized on short sentences. With this API you will be able to compare two sentences and get a score of their semantic similarity. It works even if the two sentences don't have any word in common.

element = Dandelionapi::TextSimilarity.new
response = element.analyze(text1: "This is a test", text2: "This is another test")

Language Detection API: is a simple language identification API; it is a tool that may be useful when dealing with texts, so we decided to open it to all our users. It currently supports more than 50 languages.

element = Dandelionapi::LanguageDetection.new
response = element.analyze(text: "Questo è un test")

About

Ruby Gem for Dandelion API, Semantic Text Analytics as a service

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 99.6%
  • Shell 0.4%