API for BERT-based Conversational Language Understanding.
The API expects a Bert based TFLite model with metadata populated. The metadata should contain the following information:
| class | BertCluAnnotator.BertCluAnnotatorOptions | Options for setting up a BertCluAnnotator. |
|
| CluResponse | |
| static BertCluAnnotator |
createFromBufferAndOptions(ByteBuffer modelBuffer, BertCluAnnotator.BertCluAnnotatorOptions options)
Creates a
BertCluAnnotator instance with a model buffer and BertCluAnnotator.BertCluAnnotatorOptions. |
| static BertCluAnnotator |
createFromFile(Context context, String modelPath)
Creates a
BertCluAnnotator instance from a filepath. |
Annotates the input utterances.
| cluRequest | input dialogue encoded in a CluRequest |
|---|
CluResponse
Creates a BertCluAnnotator instance with a model buffer and BertCluAnnotator.BertCluAnnotatorOptions.
| modelBuffer | a direct ByteBuffer or a MappedByteBuffer of the annotator
model |
|---|---|
| options |
| IllegalArgumentException | if the model buffer is not a direct ByteBuffer or a
MappedByteBuffer |
|---|---|
| IllegalStateException | if there is an internal error |
| RuntimeException | if there is an otherwise unspecified error |
Creates a BertCluAnnotator instance from a filepath.
| context | |
|---|---|
| modelPath | path of the annotator model |
| IOException | if an I/O error occurs when loading the tflite model |
|---|---|
| IllegalArgumentException | if an argument is invalid |
| IllegalStateException | if there is an internal error |
| RuntimeException | if there is an otherwise unspecified error |