mindtext.modules.tokenlizer.tokenization_transformer

convert_to_printable (text)

转换text成一个可打印的格式

convert_to_unicode (text)

转换text成一个Unicode格式

load_vocab_file (vocab_file)

加载一个词汇表文件并且转换成一个{token:id}的字典

convert_by_vocab_dict (vocab_file)

根据词汇字典转换[tokens|ids]的序列

class mindtext.modules.tokenlizer.tokenization_roberta.WhiteSpaceTokenizer (vocab_file)

init (vocab_file)

参数

  • vocab_file (path):字典的路径

tokenize (text)

将文本tokenizes

convert_tokens_to_ids (text)

将token转换为对于的索引

convert_ids_to_tokens (text)

将索引转换成单词