tensorflow/lite/g3doc/api_docs/python/tflite_support/task/text/BertCluAnnotator.md
page_type: reference description: Class that performs Bert CLU Annotation on text.
<link rel="stylesheet" href="/site-assets/css/style.css"> <!-- DO NOT EDIT! Automatically generated file. --> <div itemscope itemtype="http://developers.google.com/ReferenceObject"> <meta itemprop="name" content="tflite_support.task.text.BertCluAnnotator" /> <meta itemprop="path" content="Stable" /> <meta itemprop="property" content="__init__"/> <meta itemprop="property" content="annotate"/> <meta itemprop="property" content="create_from_file"/> <meta itemprop="property" content="create_from_options"/> </div>View source on GitHub
Class that performs Bert CLU Annotation on text.
<pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link"> <code>tflite_support.task.text.BertCluAnnotator( options: <a href="../../../tflite_support/task/text/BertCluAnnotatorOptions"><code>tflite_support.task.text.BertCluAnnotatorOptions</code></a>, cpp_annotator: _CppBertCluAnnotator ) -> None </code></pre> <!-- Placeholder for "Used in" --> <!-- Tabular view --> <table class="responsive fixed orange"> <colgroup><col width="214px"><col></colgroup> <tr><th colspan="2"><h2 class="add-link">Attributes</h2></th></tr> <tr> <td> `options`<a id="options"></a> </td> <td> </td> </tr> </table><a target="_blank" class="external" href="https://github.com/tensorflow/tflite-support/blob/v0.4.4/tensorflow_lite_support/python/task/text/bert_clu_annotator.py#L91-L105">View source</a>
<pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link"> <code>annotate( request: <a href="../../../tflite_support/task/processor/CluRequest"><code>tflite_support.task.processor.CluRequest</code></a> ) -> <a href="../../../tflite_support/task/processor/CluResponse"><code>tflite_support.task.processor.CluResponse</code></a> </code></pre>Performs actual Bert CLU Annotation on the provided CLU request.
<!-- Tabular view --> <table class="responsive fixed orange"> <colgroup><col width="214px"><col></colgroup> <tr><th colspan="2">Args</th></tr> <tr> <td> `request` </td> <td> The input to CLU. </td> </tr> </table> <!-- Tabular view --> <table class="responsive fixed orange"> <colgroup><col width="214px"><col></colgroup> <tr><th colspan="2">Returns</th></tr> <tr class="alt"> <td colspan="2"> The output of CLU. </td> </tr> </table> <!-- Tabular view --> <table class="responsive fixed orange"> <colgroup><col width="214px"><col></colgroup> <tr><th colspan="2">Raises</th></tr> <tr> <td> `ValueError` </td> <td> If any of the input arguments is invalid. </td> </tr><tr> <td> `RuntimeError` </td> <td> If failed to calculate the embedding vector. </td> </tr> </table> <h3 id="create_from_file"><code>create_from_file</code></h3><a target="_blank" class="external" href="https://github.com/tensorflow/tflite-support/blob/v0.4.4/tensorflow_lite_support/python/task/text/bert_clu_annotator.py#L53-L69">View source</a>
<pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link"> <code>@classmethod</code> <code>create_from_file( file_path: str ) -> 'BertCluAnnotator' </code></pre>Creates the BertCluAnnotator object from a TensorFlow Lite model.
<a target="_blank" class="external" href="https://github.com/tensorflow/tflite-support/blob/v0.4.4/tensorflow_lite_support/python/task/text/bert_clu_annotator.py#L71-L89">View source</a>
<pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link"> <code>@classmethod</code> <code>create_from_options( options: <a href="../../../tflite_support/task/text/BertCluAnnotatorOptions"><code>tflite_support.task.text.BertCluAnnotatorOptions</code></a> ) -> 'BertCluAnnotator' </code></pre>Creates the BertCluAnnotator object from Bert CLU Annotation options.