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","."]
docstr: One step for validation, which should be called as forward computation.
  Args:
      batch(:obj:List[paddle.Tensor]): The one batch data, which contains the model needed,
          such as input_ids, sent_ids, pos_ids, input_mask and labels.
      batch_idx(int): The index of batch.
  Returns:
      results(:obj: Dict) : The model outputs, such as metrics.
docstr_tok: ["One","step","for","validation",",","which","should","be","called","as","forward","computation",".","Args",":","batch","(",":","obj",":","List","[","paddle.Tensor","]",")",":","The","one","batch","data",",","which","contains","the","model","needed",",","such","as","input_ids",",","sent_ids",",","pos_ids",",","input_mask","and","labels",".","batch_idx","(","int",")",":","The","index","of","batch",".","Returns",":","results","(",":","obj",":","Dict",")",":","The","model","outputs",",","such","as","metrics","."]
code: def validation_step(self, batch: List[paddle.Tensor], batch_idx: int):
      """
      One step for validation, which should be called as forward computation.
      Args:
          batch(:obj:List[paddle.Tensor]): The one batch data, which contains the model needed,
              such as input_ids, sent_ids, pos_ids, input_mask and labels.
          batch_idx(int): The index of batch.
      Returns:
          results(:obj: Dict) : The model outputs, such as metrics.
      """
      _, _, metric = self(ids=batch[0], labels=batch[1])
      self.metric.reset()
      return {"metrics": metric}
  
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 3 for calling the BoWModel obj's underlying member method code with example usage: obj.validation_step(batch, batch_idx) and returns: dict