Learn R Programming

⚠️There's a newer version (1.14.4) of this package.Take me there.

rosette-api

This is the Rosette API client binding for R.

Getting Started

Install the module with: install.packages('rosetteAPI')

Example using the Rosette API language detection endpoint

source("Api.R")
library(rjson)

key <- "contentUri"
value <- "http://www.onlocationvacations.com/2015/03/05/the-new-ghostbusters-movie-begins-filming-in-boston-in-june/"

parameters <- list()
parameters[[ key ]] <- value
parameters <- toJSON(parameters)

result <- api("0123456789", "categories", parameters)
print(result)

API Parameters

ParameterEndpointRequired
contentcategories, entities, language, morphology, relationships, sentences, sentiment, tokensEither content or contentUri required
contentUricategories, entities, language, morphology, relationships, sentences, sentiment, tokensEither content or contentUri required
languagecategories, entities, language, morphology, relationships, sentences, sentiment, tokens, name similarityNo
documentFilecategories, entities, language, morphology, relationships, sentences, sentiment, tokensNo
name1name similarityYes
name2name similarityYes
namename translationYes
targetLanguagename translationYes
entityTypename translationNo
sourceLanguageOfOriginname translationNo
sourceLanguageOfUsename translationNo
sourceScriptname translationNo
targetScriptname translationNo
targetSchemename translationNo
optionsrelationshipsNo
accuracyModerelationshipsYes
linkedentitiesNo
explainsentimentNo
morphologymorphologyYes

Additional Information

See Rosette API site

Copy Link

Version

Install

install.packages('rosetteApi')

Monthly Downloads

74

Version

1.0

License

Apache License

Maintainer

Sam Hausmann

Last Published

May 22nd, 2016

Functions in rosetteApi (1.0)

get_endpoint

GET request to specified Rosette API endpoint
check_names

check if the required request parameters for either names endpoint are correct
check_content_parameters

preemptive check for content/contentUri request parameter errors
check_for_multipart

check if the request parameters contain multipart
to_json

convert Rosette API response content and headers to json
create_multipart

create a multipart
mutipart_call

make a multipart POST request
check_morphology

determine which morphology endpoint to use
api

api wrapper function that checks for a user_key and determines the Rosette API endpoint to be utilized
error_check

check if Rosette API response includes and error message
check_version

check if server and binding versions are compatible
post_endpoint

POST request to specified Rosette API endpoint