Sentiment Analysis

Determine positive or negative sentiment from text

Algorithmia Platform License · Internet Access · Calls Other Algorithms

Run an Example

{
"document": "I really like Algorithmia!"
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[
  {
    "sentiment": 0.474,
    "document": "I really like Algorithmia!"
  }
]

Install & Use

Use
curl -X POST -d '{
  "document": "I really like Algorithmia!"
}' -H 'Content-Type: application/json' -H 'Authorization: Simple YOUR_API_KEY' https://api.algorithmia.com/v1/algo/nlp/SentimentAnalysis/1.0.4
Use
algo run nlp/SentimentAnalysis/1.0.4 -d '{
  "document": "I really like Algorithmia!"
}'
Use
import (
  algorithmia "github.com/algorithmiaio/algorithmia-go"
)

input := map[string]interface{}{
  document: "I really like Algorithmia!"
}

var client = algorithmia.NewClient("YOUR_API_KEY")
algo, _ := client.Algo("nlp/SentimentAnalysis/1.0.4")
resp, _ := algo.Pipe(input)
response := resp.(*algorithmia.AlgoResponse)
fmt.Println(response.Result)
Use
import com.algorithmia.*;
import com.algorithmia.algo.*;

String input = "{"
 + "  \"document\": \"I really like Algorithmia!\""
 + "}";
AlgorithmiaClient client = Algorithmia.client("YOUR_API_KEY");
Algorithm algo = client.algo("nlp/SentimentAnalysis/1.0.4");
AlgoResponse result = algo.pipeJson(input);
System.out.println(result.asJsonString());
Use
var input = {
  "document": "I really like Algorithmia!"
};
Algorithmia.client("YOUR_API_KEY")
    .algo("nlp/SentimentAnalysis/1.0.4")
    .pipe(input)
    .then(function(output) {
        console.log(output);
    });
Use
using Algorithmia;

var input = "{"
 + "  \"document\": \"I really like Algorithmia!\""
 + "}";
var client = new Client("YOUR_API_KEY");
var algorithm = client.algo("nlp/SentimentAnalysis/1.0.4");
var response = algorithm.pipeJson<object>(input);
Console.WriteLine(response.result);
Use
var input = {
  "document": "I really like Algorithmia!"
};
Algorithmia.client("YOUR_API_KEY")
    .algo("nlp/SentimentAnalysis/1.0.4")
    .pipe(input)
    .then(function(response) {
        console.log(response.get());
    });
Use
import Algorithmia

input = {
  "document": "I really like Algorithmia!"
}
client = Algorithmia.client('YOUR_API_KEY')
algo = client.algo('nlp/SentimentAnalysis/1.0.4')
print(algo.pipe(input))
Use
library(algorithmia)

input <- list("document"="I really like Algorithmia!")
client <- getAlgorithmiaClient("YOUR_API_KEY")
algo <- client$algo("nlp/SentimentAnalysis/1.0.4")
result <- algo$pipe(input)$result
print(result)
Use
require 'algorithmia'

input = {
  document: "I really like Algorithmia!"
}
client = Algorithmia.client('YOUR_API_KEY')
algo = client.algo('nlp/SentimentAnalysis/1.0.4')
puts algo.pipe(input).result
Use
use algorithmia::Algorithmia;

let input = json!({
  "document": "I really like Algorithmia!"
});
let client = Algorithmia::client("YOUR_API_KEY");
let algo = client.algo("nlp/SentimentAnalysis/1.0.4");
let response = algo.pipe(input);
Use
import com.algorithmia._
import com.algorithmia.algo._

val input = """{
  "document": "I really like Algorithmia!"
}"""
val client = Algorithmia.client("YOUR_API_KEY")
val algo = client.algo("nlp/SentimentAnalysis/1.0.4")
val result = algo.pipeJson(input)
System.out.println(result.asJsonString)
Use
import Algorithmia

let input = "{"
 + "  \"document\": \"I really like Algorithmia!\""
 + "}";
let client = Algorithmia.client(simpleKey: "YOUR_API_KEY")
let algo = client.algo(algoUri: "nlp/SentimentAnalysis/1.0.4")
algo.pipe(rawJson: input) { resp, error in
  print(resp)
}