parallel_dots v0.1.0 ParallelDots View Source

Elixir Wrapper for ParallelDots APIs

Http Code

200: Successful response
304: There was no new text to return
500: Backend Error
400: Please provide valid input parameter
401: Invalid Credentials. Please provide valid API key
403: Daily/Monthy Limit Exceeded
429: Too Many Requests. Please try after sometime
406: Invalid Format

Link to this section Summary

Functions

Extract name or sentiment from given text

Link to this section Functions

Link to this function text_analysis(text, type) View Source

Extract name or sentiment from given text

Functionality

Send POST request to ParallelDots API with a text to extract names from it

Parameters

text::String api_key::String

Returns

if type = name

in case of finding names  
`{:ok, %{"code" => 200, "entities" => ["category" => "name", "confidence_score" => Float, "name" => String, ...]}}`  
in case of didnt find names  
`{:ok, %{"code" => 200, "entities" => "The statement belongs to none of the categories."}}`  
in case of the HTTPoison failt to execute the request  
`{:error, reason}`  

if type = sentiment in case of successful call {:ok, %{"code" => 200, "probabilities" => %{"negative" => 0.134, "neutral" => 0.29, "positive" => 0.576}, "sentiment" => "positive"}}
in case of the HTTPoison failt to execute the request {:error, reason}