Rosette API R Binding

Chris Park

2019-03-14

Introduction

Welcome to the Rosette API suite of linguistic tools and services for R! With the Rosette API endpoints you can extract entities and relationships, translate and compare names, and analyze sentiment of documents and entities from large amounts of unstructured text.

Limits

Rosette can process one call at a time. You can send a second call once you have received a response from the first.

The maximum payload size is 600KB, with a maximum character count of 50,000.

Authentication

Rosette uses API keys to allow access to the API. You can find your Rosette API key on our Developer Portal, or Sign Up for a new API key.

Features and Functions

Visit our Features and Functions page for a more detailed look at the functionality of the Rosette API endpoints.

API Parameters

Parameter Endpoint Required
content categories, entities, language, morphology, relationships, sentences, sentiment, tokens, topics, syntax/dependencies, transliteration (Yes) Either content or contentUri required
contentUri categories, entities, language, morphology, relationships, sentences, sentiment, tokens, topics, syntax/dependencies Either content or contentUri required
language categories, entities, language, morphology, relationships, sentences, sentiment, tokens, topics, name similarity No
documentFile categories, entities, language, morphology, relationships, sentences, sentiment, tokens, topics No
name1 name similarity Yes
name2 name similarity Yes
name name translation Yes
targetLanguage name translation, transliteration (No) Yes
entityType name translation No
sourceLanguageOfOrigin name translation No
sourceLanguageOfUse name translation No
sourceScript name translation, transliteration No
sourceLanguage transliteration Yes
targetScript name translation, transliteration No
targetScheme name translation No
options relationships No
accuracyMode relationships Yes
explain sentiment No
morphology morphology Yes

Example using the Rosette API categories endpoint

library(rosetteApi)
library(jsonlite)

parameters <- list()
parameters[[ "contentUri" ]] <- "https://onlocationvacations.com/2015/03/05/the-new-ghostbusters-movie-begins-filming-in-boston-in-june/"

result <- api("0123456789", "categories", parameters = parameters)
# result is a list containing content and headers in native R.  Use jsonlite::toJSON() to convert to JSON format.
print(jsonlite::toJSON(result$content, pretty = TRUE)