New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sentiment_analysis

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sentiment_analysis

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

The SentimentAnalysis Ruby gem

A Ruby wrapper for the SentimentAnalysis API

see : http://viralheat.com/developer/sentiment_api

Installation

gem install sentiment_analysis

How to use

Simple way

require 'sentiment_analysis'
sa = SentimentAnalysis::Client.new(:api_key => '0123456789')

puts sa.quota
  # => 5000

puts as.review("i don't like this")
  # => {"prob":0.732603741199471,"mood":"negative","text":"i don't like this"}

puts as.train(:text => "I don't like coffee'",:mood => 'negative')
  # => {"status":"ok"}

Choose the format - :json

puts sa.quota(:format => :json)
  # => {"quota_remaining":5000}

Choose the format - :xml

puts sa.quota(:format => :xml)
  # => <?xml version="1.0" encoding="UTF-8"?>
	   <result>
  	     <quota_remaining>4976</quota_remaining>
	   </result>

puts as.review("i don't like this", :format => :xml)
  # => <?xml version="1.0" encoding="UTF-8"?>
	   <result>
	     <text>I don't like coffee</text>
	     <mood>negative</mood>
	     <prob>0.55865964876338</prob>
	   </result>

puts as.train(:text => "I don't like coffee'",:mood => 'negative', :format => :xml)
  # => <?xml version="1.0" encoding="UTF-8"?>
	   <result>
	     <status>ok</status>
	   </result>

FAQs

Package last updated on 14 Sep 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc