地址链接:https://www.flyai.com/m/sgns.merge.word
查看来源:https://pan.baidu.com/s/1luy-GlTdqqvJ3j-A4FcIOw
确定自己使用的框架并导入对应的库。导入库实现样例代码可参考 文档中心-预训练模型使用教程
在代码中实现加载预训练模型地址
lexicon_f = open(yangjie_rich_pretrain_word_path,'r',encoding='utf-8')
output_f = open(yangjie_rich_pretrain_char_and_word_path,'w',encoding='utf-8')
lexicon_lines = lexicon_f.readlines()
for l in lexicon_lines:
l_split = l.strip().split()
if len(l_split[0]) != 1:
print(l.strip(),file=output_f)