Wrapper functions for using COTOHA API from R. COTOHA API is a natural language processing API by NTT Comunnications. This API is only for Japanese text. You can check details on COTOHA API here. This is just an interface by a volunteer (not by a company). So you have to register for COTOHA API and you must follow the terms of use by NTT Comunnications.
remotes::install_github("ocean-v/rcotoha")
You have to check out the information about API on your account home page.
make_cotoha_config(clientId = "xxxxxx", clientSecret = "xxxxxx", tokenURL = "https://xxxxxx", baseURL = "https://xxxxxx")
You will get "config.json" & "endpoint.json" on your current working directory.
get_cotoha_token(config = "config.json", endpoint = "endpoint.json")
Details here -> https://api.ce-cotoha.com/contents/reference/apireference.html
execute_cotoha_analysis(
access_token = "Your access token",
API = "parse",
sentence = "Your text"
)
execute_cotoha_analysis(
access_token = "Your access token",
API = "ne",
sentence = "Your text"
)
execute_cotoha_analysis(
access_token = "Your access token",
API = "coreference",
document = "Your text"
)
execute_cotoha_analysis(
access_token = "Your access token",
API = "keyword",
document = "Your text"
)
execute_cotoha_analysis(
access_token = "Your access token",
API = "similarity",
s1 = "Your text1",
s2 = "Your text2"
)
execute_cotoha_analysis(
access_token = "Your access token",
API = "sentence_type",
sentence = "Your text"
)
execute_cotoha_analysis(
access_token = "Your access token",
API = "sentence_type",
sentence = "Your text"
)
# example
execute_cotoha_analysis(
access_token = "Your access token",
API = "keyword",
document = "Your text",
opptional = list(max_keyword_num = 10)
)
Mainly for Named entity extraction 固有表現抽出 & Keyword extraction キーワード抽出.
cotoha_as_df(response = [your response])
Otherwise, you can extract the result as a list from the response by httr::content
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.