This is the implementation of word embedding (a.k.a word representation) models in Golang.
Word embedding makes word's meaning, structure, and concept mapping into vector space with low dimension. For representative instance:
Vector("King") - Vector("Man") + Vector("Woman") = Vector("Queen")
Like this example, the models generate the vectors that could calculate word meaning by arithmetic operations for other vectors.
- Word2Vec
- Distributed Representations of Words and Phrases and their Compositionality [pdf]
- GloVe
- GloVe: Global Vectors for Word Representation [pdf]
and more...
$ go get -u github.com/ynqa/wego
$ bin/wego -h
tools for embedding words into vector space
Usage:
wego [flags]
wego [command]
Available Commands:
glove GloVe: Global Vectors for Word Representation
help Help about any command
repl Search similar words with REPL mode
search Search similar words
word2vec Word2Vec: Continuous Bag-of-Words and Skip-gram model
Flags:
-h, --help help for wego
Use "wego [command] --help" for more information about a command.
For more information about each sub-command, see below:
Downloading text8 corpus, and training by Skip-Gram with negative sampling.
$ sh demo.sh
Output a file is subject to the following format:
<word> <value1> <value2> ...