matlab_word2vec_bin​ary_reader

バージョン 1.2 (6.15 KB) 作成者: Toru Ikegami
readW2Vbin - MATLAB utility to read binary word2vec embedding model file
ダウンロード: 48
更新 2020/6/25

Use `readW2Vbin` to read a pre-trained word2vec word embedding model in the binary format. It assumes that the file is written in the following format.

- The data before the first `0x20` (space) are ascii characters representing the number of vocabularies of the model , while the data between the first `0x20` and the first `0x10` (newline) represent the dimension of the word vector. (e.g.,`[ 51 48 48 48 48 48 48 32 51 48 48 10] ` means 3 milion words embedded into 300 dimensions. )
- The main body, which consists of sequence of word-vector pairs, begins right after the newline character. One word-vector pair consists of a sequence of bytes that represents a word, space (0x20), and a sequence of binary data that represents the embedded vector corresponding to the word in single precision (32bit) format. The length of the vector data is 4bytes times number of dimensions (e.g., 1200 bytes for 300 dimension).

This function was tested with the "GoogleNews-vectors-negative300.bin" from the word2vec web (https://code.google.com/archive/p/word2vec/). It took about a minute to read the 3.5GB file.

引用

Toru Ikegami (2024). matlab_word2vec_binary_reader (https://github.com/mathworks/matlab_word2vec_binary_reader/releases/tag/v1.2), GitHub. 取得済み .

MATLAB リリースの互換性
作成: R2019b
R2019b 以降 R2020a 以前と互換性あり
プラットフォームの互換性
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.2

See release notes for this release on GitHub: https://github.com/mathworks/matlab_word2vec_binary_reader/releases/tag/v1.2

1.1

See release notes for this release on GitHub: https://github.com/mathworks/matlab_word2vec_binary_reader/releases/tag/v1.1

1.0

この GitHub アドオンでの問題を表示または報告するには、GitHub リポジトリにアクセスしてください。
この GitHub アドオンでの問題を表示または報告するには、GitHub リポジトリにアクセスしてください。