ltp: R Interface of LTP-cloud service

Description Usage Arguments Examples

View source: R/ltp.R

Description

This function deals with communication with the server. XML result will be parsed if the mission is word-splitting. Else the raw XML texts will be returned for further analysis.

Usage

1
2
ltp(input = NULL, file = NULL, mission = "ws",
  api_key = getOption("ltp_api_key"), maxUpload = 1e+05)

Arguments

input

The input text.

file

The input file.

mission

Expected result for the cloud server, may be unfinished. Optional choices are 'ws' for word-splitting, 'pos' for part-of-speech, 'ner' for named entity recognition, 'dp' for dependency parser, 'srl' for semantic role labeling, 'all' for all missions.

api_key

Your API_Key for the cloud server. Visit http://www.ltp-cloud.com/dashboard/ to get it.

maxUpload

Due to the limitation of the server, we cut the input in pieces.

Examples

1
2
3
4
5
6
7
8
## Not run: 
# require(rLTP)
# This api_key is publicly accessible.
# So it is strongly recommended to register for your own key.
# options(ltp_api_key='l2T9N724koSqEcDJvQHtRGVV2erajgPOgB0FAcLj')
# ltp('Replace this field with a Chinese sentence.')

## End(Not run)

hetong007/rLTP documentation built on May 17, 2019, 3:43 p.m.