问题描述
我最近下载了用于英语的 fasttext 预训练模型.我有两个文件:
I recently downloaded fasttext pretrained model for english. I got two files:
- wiki.en.vec
- wiki.en.bin
我不确定这两个文件有什么区别?
I am not sure what is the difference between the two files?
推荐答案
.vec
文件仅包含纯文本形式的聚合词向量..bin
文件另外包含模型参数,最重要的是,包含所有 n-gram 的向量.
The .vec
files contain only the aggregated word vectors, in plain-text. The .bin
files in addition contain the model parameters, and crucially, the vectors for all the n-grams.
因此,如果您想使用那些 n-gram(FastText 著名的子词信息")对未训练过的单词进行编码,您需要找到一个可以处理 FastText 的 API.bin
文件(大多数只支持 .vec
文件,但是...).
So if you want to encode words you did not train with using those n-grams (FastText's famous "subword information"), you need to find an API that can handle FastText .bin
files (most only support the .vec
files, however...).
这篇关于Fasttext .vec 和 .bin 文件的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!