Skip to content

mistidoi/word-embedding

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Word Embedding in Golang

Build Status

This is an implementation of word embedding (also referred to as word representation) models in Golang.

Details

Word embedding makes words' meaning, structure, and concept mapping into vector space (and low dimension). For representative instance:

Vector("king") - Vector("Man") + Vector("Woman") = Vector("Queen")

Like this example, it could calculate word meaning by arithmetic operations between vectors.

Features

Listed models for word embedding, and checked it already implemented.

Models

  • Word2vec
    • Distributed Representations of Words and Phrases and their Compositionality [pdf]
  • GloVe
    • GloVe: Global Vectors for Word Representation [pdf]
  • SPPMI-MF
    • Neural Word Embedding as Implicit Matrix Factorization [pdf]

Installation

$ go get -u github.com/ynqa/word-embedding
$ bin/word-embedding -h

Usage

The tools embedding words into vector space

Usage:
  word-embedding [flags]
  word-embedding [command]

Available Commands:
  word2vec    Embed words using word2vec

File I/O

  • Input
    • Given a text is composed of one-sentence per one-line, ideally.
  • Output
    • Output a file is like libsvm format:
    <word> <index1>:<value1> <index2>:<value2> ...
    

References

  • Just see it for more deep comprehension:
    • Improving Distributional Similarity with Lessons Learned from Word Embeddings [pdf]
    • Don’t count, predict! A systematic comparison of context-counting vs. context-predicting semantic vectors [pdf]

About

Word Embedding (word2vec, GloVe) in Golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%