tensorflow/lite/g3doc/api_docs/java/org/tensorflow/lite/task/text/bertclu/BertCluAnnotator.html
public class BertCluAnnotator
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 | annotate(CluRequest cluRequest) Annotates the input utterances.
|
| 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.
|
From class org.tensorflow.lite.task.core.BaseTaskApi
| synchronized void | close() Release the memory allocated from C++ and deregister the library from the static holder.
| | long | getNativeHandle() | | boolean | isClosed() |
From class java.lang.Object
| boolean | equals(Object arg0) | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |
From interface java.io.Closeable
| abstract void | close() |
From interface java.lang.AutoCloseable
| abstract void | close() |
Annotates the input utterances.
| cluRequest | input dialogue encoded in a CluRequest |
CluResponseCreates 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 |