class_docstr: This class implements the Bag of Words Classification Network model to classify texts.
  At a high level, the model starts by embedding the tokens and running them through
  a word embedding. Then, we encode these epresentations with a `BoWEncoder`.
  Lastly, we take the output of the encoder to create a final representation,
  which is passed through some feed-forward layers to output a logits (`output_layer`).
  Args:
      vocab_size (obj:`int`): The vocabulary size.
      emb_dim (obj:`int`, optional, defaults to 300):  The embedding dimension.
      hidden_size (obj:`int`, optional, defaults to 128): The first full-connected layer hidden size.
      fc_hidden_size (obj:`int`, optional, defaults to 96): The second full-connected layer hidden size.
      num_classes (obj:`int`): All the labels that the data has.
class_docstr_tok: ["This","class","implements","the","Bag","of","Words","Classification","Network","model","to","classify","texts",".","At","a","high","level",",","the","model","starts","by","embedding","the","tokens","and","running","them","through","a","word","embedding",".","Then",",","we","encode","these","epresentations","with","a","`","BoWEncoder","`",".","Lastly",",","we","take","the","output","of","the","encoder","to","create","a","final","representation",",","which","is","passed","through","some","feed-forward","layers","to","output","a","logits","(","`","output_layer","`",")",".","Args",":","vocab_size","(","obj",":","`","int","`",")",":","The","vocabulary","size",".","emb_dim","(","obj",":","`","int","`",",","optional",",","defaults","to","300",")",":","The","embedding","dimension",".","hidden_size","(","obj",":","`","int","`",",","optional",",","defaults","to","128",")",":","The","first","full-connected","layer","hidden","size",".","fc_hidden_size","(","obj",":","`","int","`",",","optional",",","defaults","to","96",")",":","The","second","full-connected","layer","hidden","size",".","num_classes","(","obj",":","`","int","`",")",":","All","the","labels","that","the","data","has","."]
code: def predict(
      self,
      data: List[List[str]],
      max_seq_len: int = 128,
      batch_size: int = 1,
      use_gpu: bool = False,
      return_result: bool = True,
  ):
      paddle.set_device("gpu") if use_gpu else paddle.set_device("cpu")
  
      batches = self._batchify(data, max_seq_len, batch_size)
      results = []
      self.eval()
      for batch in batches:
          ids = paddle.to_tensor(batch)
          probs = self(ids)
          idx = paddle.argmax(probs, axis=1).numpy()
  
          if return_result:
              idx = idx.tolist()
              labels = [self.label_map[i] for i in idx]
              results.extend(labels)
          else:
              results.extend(probs.numpy())
  
      return results
  
file_path: PaddleHub/demo/text_classification/embedding/model.py
imports: import os
  from typing import List
  import paddle
  import paddle.nn
  import paddle.nn.functional
  import paddlenlp
  from paddlenlp.embeddings import TokenEmbedding
  from paddlenlp.data import JiebaTokenizer
  from paddlehub.utils.log import logger
  from paddlehub.utils.utils import pad_sequence, trunc_sequence
label_desc: Use image node_id 6 for calling the BoWModel obj's underlying member method code with example usage: obj.predict(data, max_seq_len, batch_size, use_gpu, return_result) and returns: results