SyllabsApi

Syllabs develops advanced technologies for semantic analysis of text content. These technologies are now made available on the web through the Syllabs API.

Using the Syllabs API, you can harness the power of our semantic analysis platform in your own web site or application.

Features

We’re starting with the following key features, and we’ll be adding more.

Language detection the API can automatically identify the language and encoding of your text. Information extraction the API can extract key terms and “named entities” (people, places…) from your text, that you can use to add semantic tags to your content. Related keywords Starting with one or more terms, the API can generate a set of related keywords, that you can use to link to similar topics.

Installation

Add this line to your application's Gemfile:

gem 'syllabs-api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install syllabs-api

Usage

Language detection

#encoding: utf-8
require 'syllabs-api'

API_KEY = 'Your API Key...'
client = SyllabsApi::Client.new(API_KEY)

text_fr = 'Rarement un contrat passé par la Ville de Paris aura aussi bien porté son nom'
text_en = 'Spanish Prime Minister Mariano Rajoy announces new austerity measures including a 3% rise in VAT, as thousands of miners protest against big subsidy cuts.'

client.languages(text_fr).each do |language|
  puts "#{language.name}: #{language.score}%"
end

client.languages(text_en).each do |language|
  puts "#{language.name}: #{language.score}%"
end

Named Entity Extraction

text = 'Il étaient plusieurs dizaines de milliers venant des Asturies, de Castille et Leon et d\'Aragon, d\'anciens bassins de charbons d\'Espagne aujourd\'hui mourants. Après plus de 400 kilomètres à pied depuis le nord du pays, la "marche noire" des mineurs espagnols est arrivée, mercredi 11 juillet, à Madrid.'

client.entities(text).each do |entity|
  puts "#{entity.name} (#{entity.type}): #{entity.count}"
end

Terms Extraction

text = 'The Russian government shares many of the U.S. concerns about the continuing violence in Syria, but Moscow is reluctant to embrace Washington\'s proposals to solve them because it is wary of its motives, experts say.'

client.terms(text).each do |term|
  puts "#{term.text}: #{term.lemma}"
end

Sentiment Analysis

text = 'Notre meilleur souvenir du mois que nous avons passé au Sri Lanka. Un accueil tout particulièrement chaleureux et sympathique de Chanie et Lali, les jeunes propriétaires de cette guesthouse qui offre trois chambres confortables et tenues de façon impeccable. Et toujours des améliorations : nous avons eu l\'agréable surprise d\'avoir l\'eau chaude récemment installée dans notre chambre.'

client.evaluations(text).each do |e|
  puts "#{e.object}: #{e.eval}"
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request