Description Usage Arguments Value See Also Examples
View source: R/keyword_relevance.R
See the sign-up documentation for step by step instructions to secure your own username and password to enable you to use the Watson NLU API. The keyword_relevance function takes a text or URL input, along with the input type. The function then returns a dataframe that contains keywords and their likelihood of being a keyword, from the given input. See the keyword_relevance documentation for more usage cases.
1 2 | keyword_relevance(input = NULL, input_type = NULL, limit = NULL,
version = "?version=2018-03-16")
|
input |
Either a text string input or website URL.
Either |
input_type |
Specify what type of input was entered.
Either |
limit |
The number of keywords to return. |
version |
The release date of the API version to use. Default value is |
A dataframe containing a list of keywords and their corresponding likelihoods for the given input.
keyword_sentiment
, \link[watsonNLU]{text_categories}
, \link[watsonNLU]{keyword_emotions}
, \link[watsonNLU]{auth_NLU}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | credentials <- readRDS("../tests/testthat/credentials.rds")
username <- credentials$username
password <- credentials$password
# Authenticate using Watson NLU API Credentials
auth_NLU(username, password)
# Authenticate using Watson NLU API Credentials
auth_NLU(username="XXXX", password="XXXX")
# Top 5 keywords from the text input.
keyword_relevance(input = 'This is a great API wrapper', input_type='text', limit = 5)
# Top 5 keywords from the URL input.
keyword_relevance(input = 'http://www.nytimes.com/guides/well/how-to-be-happy', input_type='url', limit = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.