def embedding(self, sentences, oov_way='<STR_LIT>'):
data_iter = self.data_loader(sentences=sentences)<EOL>batches = []<EOL>for token_ids, valid_length, token_types in data_iter:<EOL><INDENT>token_ids = token_ids.as_in_context(self.ctx)<EOL>valid_length = valid_length.as_in_context(self.ctx)<EOL>token_types = token_types.as_in_context(self.ctx)<EOL>sequence_outputs = self.bert(token_ids, token_types,<EOL>valid_length.astype(self.dtype))<EOL>for token_id, sequence_output in zip(token_ids.asnumpy(),<EOL>sequence_outputs.asnumpy()):<EOL><INDENT>batches.append((token_id, sequence_output))<EOL><DEDENT><DEDENT>return self.oov(batches, oov_way)<EOL>
Get tokens, tokens embedding

Parameters
----------
sentences : List[str]
    sentences for encoding.
oov_way : str, default avg.
    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