public class TextRecognizer extends APIRequestBase
Modifier and Type | Field and Description |
---|---|
static int |
RQ_DATA_INPUT_TYPE_FROM_SPEECH |
static int |
RQ_DATA_INPUT_TYPE_FROM_TEXT |
static String |
RQ_DATA_TYPE_STT |
Constructor and Description |
---|
TextRecognizer(APIConfiguration configuration)
Text Recognizer to issue Natural Language Understanding API requests.
|
Modifier and Type | Method and Description |
---|---|
APIResponse |
requestNLI(String text)
Request Natural Language Interaction service by specified input text.
|
APIResponse |
requestNLI(String text,
NLIConfig nliConfig)
Request Natural Language Interaction service by specified input text.
|
APIResponse |
requestWordSegmentation(String text)
Request word segmentation analyze service by specified input text.
|
void |
setNLIDataInputType(int inputType)
Set NLI data input type.
|
getConfiguration, getEndUserIdentifier, getSdkType, getTimeout, setConfiguration, setEndUserIdentifier, setSdkType, setTimeout
public static final String RQ_DATA_TYPE_STT
public static final int RQ_DATA_INPUT_TYPE_FROM_SPEECH
public static final int RQ_DATA_INPUT_TYPE_FROM_TEXT
public TextRecognizer(APIConfiguration configuration)
configuration
- - API configurations.public void setNLIDataInputType(int inputType)
inputType
- 0 for speech source, or 1 for text source.public APIResponse requestWordSegmentation(String text) throws NoSuchAlgorithmException, IOException
text
- - The text to be analyzed.NoSuchAlgorithmException
- Failed to create signature.IOException
- HTTP connection failed, or other exceptions.public APIResponse requestNLI(String text) throws NoSuchAlgorithmException, IOException
text
- - The text to be recognized.NoSuchAlgorithmException
- Failed to create signature.IOException
- HTTP connection failed, or other exceptions.public APIResponse requestNLI(String text, NLIConfig nliConfig) throws NoSuchAlgorithmException, IOException
text
- - The text to be recognized.nliConfig
- - NLIConfig object.NoSuchAlgorithmException
- Failed to create signature.IOException
- HTTP connection failed, or other exceptions.Copyright © 2018. All rights reserved.