Project

datagun

0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby interface to the Datagun API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 2.1.0
 Project Readme

Datagun

Build Status

A Ruby interface to the Datagun API.

Installation

Add this line to your application's Gemfile:

gem 'datagun'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install datagun

Usage

  Datagun.configure do |config|
    config.api_key = 'token'
    config.api_version = 'v1'
  end

Top keywords

Define a client and you gen upload your corpus. You can list your models, check a single model status, delete a model and analyze your text.

  client = Datagun::Api::KeywordsExtractor::Client.new

  client.save_model(name: 'italian', file: File.open('/Users/giovannelli/Desktop/models/it.csv'))
  # list models
  client.models

  # Get model status
  # model statuse: processin, ready, failed
  client.status(model_id: "model id")

  # Delete a model
  client.delete(model_id: "model id")

  # analyze your text getting keywords with scores
  client.analyze(text: "lorem ispum dolor sic amet", model_id: "model id")

Community Detection

Define a client call detect

  client = Datagun::Api::KeywordsExtractor::Client.new

  # Return a list of communities
  client.detect(graph: 'json')

Image hash

Define a client and call perceptual

  client = Datagun::Api::KeywordsExtractor::Client.new

  # Return a list of communities
  client.perceptual(url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/Ruby_logo.svg/360px-Ruby_logo.svg.png')

TODO

  • Add tests to all clients methods

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/datagun.

License

The gem is available as open source under the terms of the MIT License.