09.05.2023 Views

pdfcoffee

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

TensorFlow for Mobile and IoT and TensorFlow.js

Text classification

TensorFlow Lite comes with a model for text classification and sentiment analysis

(https://www.tensorflow.org/lite/models/text_classification/

overview) trained on the Large Movie Review Dataset v1.0 (http://ai.stanford.

edu/~amaas/data/sentiment/) with IMDb movie reviews that are positive or

negative. An example of text classification is given in Figure 8:

Figure 8: An example of Text classification on Android with TensorFlow Lite

Question and answering

TensorFlow Lite also includes (https://www.tensorflow.org/lite/models/

bert_qa/overview) a pretrained model for answering questions based on text

fragments. The model is based on a compressed variant of BERT [6] (see Chapter 7,

Word Embeddings) called MobileBERT [7], which runs 4x faster and has 4x smaller

size. An example of Q&A is given in Figure 9:

[ 472 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!