Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
## Word2Vec in a non overengineered file format
|
| 6 |
+
|
| 7 |
+
This is the [Word2Vec](https://code.google.com/archive/p/word2vec/) bag of words embedding by Google(TM) converted in a sane binary format that you can read with a trivial program, without resorting to complicated libraries.
|
| 8 |
+
|
| 9 |
+
This is the format:
|
| 10 |
+
|
| 11 |
+
1. All the integers are unsigned, in little endian format.
|
| 12 |
+
2. Floating point numbers of the embedding vectors are stored as single precision floating point numbers, float32.
|
| 13 |
+
|
| 14 |
+
The file starts with a header of 8 bytes:
|
| 15 |
+
|
| 16 |
+
uint32_t num_entries // Number of entries: 3000000 in this file
|
| 17 |
+
uint32_t dimension // Embedding dimension: 300 in this file
|
| 18 |
+
|
| 19 |
+
Then each entry is stored as:
|
| 20 |
+
|
| 21 |
+
uint16_t word_len // Length of the UTF-8 encoded word.
|
| 22 |
+
word_len bytes // UTF-8 encoded word.
|
| 23 |
+
float[300] // 300 float32 numbers, 1200 bytes in total.
|
| 24 |
+
|
| 25 |
+
The license is the same as Google's original Word2Vec, Apache 2.0.
|