def oov(self, batches, oov_way='<STR_LIT>'):
sentences = []<EOL>for token_ids, sequence_outputs in batches:<EOL><INDENT>tokens = []<EOL>tensors = []<EOL>oov_len = <NUM_LIT:1><EOL>for token_id, sequence_output in zip(token_ids, sequence_outputs):<EOL><INDENT>if token_id == <NUM_LIT:1>:<EOL><INDENT>break<EOL><DEDENT>if token_id in (<NUM_LIT:2>, <NUM_LIT:3>):<EOL><INDENT>continue<EOL><DEDENT>token = self.vocab.idx_to_token[token_id]<EOL>if token.startswith('<STR_LIT>'):<EOL><INDENT>token = token[<NUM_LIT:2>:]<EOL>tokens[-<NUM_LIT:1>] += token<EOL>if oov_way == '<STR_LIT>':<EOL><INDENT>tensors[-<NUM_LIT:1>] = sequence_output<EOL><DEDENT>else:<EOL><INDENT>tensors[-<NUM_LIT:1>] += sequence_output<EOL><DEDENT>if oov_way == '<STR_LIT>':<EOL><INDENT>oov_len += <NUM_LIT:1><EOL><DEDENT><DEDENT>else:  <EOL><INDENT>if oov_len > <NUM_LIT:1>:<EOL><INDENT>tensors[-<NUM_LIT:1>] /= oov_len<EOL>oov_len = <NUM_LIT:1><EOL><DEDENT>tokens.append(token)<EOL>tensors.append(sequence_output)<EOL><DEDENT><DEDENT>if oov_len > <NUM_LIT:1>:  <EOL><INDENT>tensors[-<NUM_LIT:1>] /= oov_len<EOL><DEDENT>sentences.append((tokens, tensors))<EOL><DEDENT>return sentences<EOL>
How to handle oov. Also filter out [CLS], [SEP] tokens.

Parameters
----------
batches : List[(tokens_id,
                sequence_outputs,
                pooled_output].
    batch   token_ids (max_seq_length, ),
            sequence_outputs (max_seq_length, dim, ),
            pooled_output (dim, )
oov_way : str
    use **avg**, **sum** or **last** to get token embedding for those out of
    vocabulary words

Returns
-------
List[(List[str], List[ndarray])]
    List of tokens, and tokens embedding