text_translate: IBM Language Translation API.

Description Usage Arguments Value See Also

View source: R/text_cognizers.R

Description

Translates text from Arabic, French, Portuguese or Spanish to English. Requires basic authentication using username and password.

Usage

1
2
text_translate(text, userpwd, keep_data = "true", callback = NULL,
  model_id = "es-en-conversational", accept = "application/json")

Arguments

text

Character vector.

userpwd

Character scalar that contains 'username:password' string.

keep_data

Character scalar specifying whether to share your data with Watson services for the purpose of training their models.

callback

Function that can be applied to responses to examine http status, headers, and content, to debug or to write a custom parser for content. The default callback parses content into a data.frame while dropping other response values to make the output easily passable to tidyverse packages like dplyr or ggplot2. For further details or debugging one can pass a fail or a more compicated function.

model_id

Character scalar formated as 'source-target-domain'. Source language (Arabic, Brazilian Portuguese, English, French, Italian, or Spanish), target language (Arabic, Brazilian Portuguese, English, French, Italian, or Spanish) and domain of text (conversational, news, patent). Check IBM documentation for other language mappings.

accept

Character scalar that specifies response format. Alternative is text/plain.

Value

Data.frame containing parsed content in a tidy fashion.

See Also

Check http://www.ibm.com/watson/developercloud/language-translation.html for further documentation, and https://language-translator-demo.mybluemix.net/ for a web demo.


ColumbusCollaboratory/cognizer documentation built on May 6, 2019, 12:49 p.m.