This is a C++ beginner’s implementation of GloVe word vectors. During the implementation I learnt lots of C++ including some C++11 features. The project is aimed at studying and the code is not fully tested. Use this project at your own risk!
- Armadillo: C++ linear algebra library
- A simple single-header C++11 STL-only argument parser library
- cereal - A C++11 library for serialization
I develop this under macOS 10.12.6
using Apple LLVM version 9.0.0
(clang-900.0.38)
and cmake version 3.10.0
. I don’t known much about C++ cross
platform compilation yet. But if you have all dependencies installed, you may
try to the following command the project root
mkdir build && cd build && cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release && cmake --build .
Once the compilation is finished, you can train GloVe word vectors by running
./build/train [-h]
and perform word analogy task by running
./build/analogy [-h]
Good luck!
- Jeffrey Pennington, Richard Socher, and Christopher D. Manning. 2014. GloVe: Global Vectors for Word Representation.