list(vocab.token_to_idx.items()) 先用items函数转换为键值对dict_items([('<unk>', 0),xxx对象,再用list转为list。
dict_items([('<unk>', 0),xxx
list