← 开源
ynqa

wego

Word Embeddings in Go!

Model DevelopmentClassical MLGo
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
508
Star
45
Fork
+1
本周
7
贡献者
创建于 2017-01-30 · 更新于 2026-10-12 · 今日第 18146 名
主要开发者
ynqachewxySlashGordon

ynqa/wego 排名第 18,146,有 508 个星标。

同类别比较

ynqa/wego 排名第 18,146,此处有 8 个同类条目;shrubb/box-convolutions 排名第 18,145。

同类别比较
名称排名指标
HRLTY/TP-GAN18,130
语言:
Python
星标数:
508
分叉数:
126
简介:
Official TP-GAN Tensorflow implementation for paper "Beyond Face Rotation: Global and Local Perception GAN for Photorealistic and Identity Preserving Frontal View Synthesis"
RobvanGastel/dinov3-finetune18,132
语言:
Jupyter Notebook
星标数:
508
分叉数:
38
简介:
Testing adaptation of the DINOv2/3 encoders for vision tasks with Low-Rank Adaptation (LoRA)
cdt15/lingam18,134
语言:
Python
星标数:
508
分叉数:
74
简介:
Python package for causal discovery based on LiNGAM.
shrubb/box-convolutions18,145
语言:
C++
星标数:
508
分叉数:
34
简介:
PyTorch code for the "Deep Neural Networks with Box Convolutions" paper
AI4Finance-Foundation/FinRL_Podracer18,147
语言:
Python
星标数:
507
分叉数:
121
简介:
Cloud-native Financial Reinforcement Learning
VikParuchuri/textbook_quality18,152
语言:
Python
星标数:
507
分叉数:
45
简介:
Generate textbook-quality synthetic LLM pretraining data
hfslyc/AdvSemiSeg18,157
语言:
Python
星标数:
507
分叉数:
122
简介:
Adversarial Learning for Semi-supervised Semantic Segmentation, BMVC 2018
msracver/Deep-Exemplar-based-Colorization18,159
语言:
Python
星标数:
507
分叉数:
75
简介:
The source code of "Deep Exemplar-based Colorization".
关键参数与规格
关键参数与规格
参数值
语言Go
类别Model Development
子类别Classical ML
关键词Embeddings, Go
星标数508
分叉数45
贡献者7
创建日期2017-01-30
更新日期2026-10-12
1 天星标数0
7 天星标数1
排名18,146
上次排名17,908
排名变化-238
7 天星标排名11,587
上次 7 天星标排名11,635
7 天星标排名变化48
总星标排名19,142
上次总星标排名19,116
总星标排名变化-26
国家Japan
README 摘录

Word Embeddings in Go *wego* is the implementations **from scratch** for word embeddings (a. Word embeddings make words' meaning, structure, and concept mapping into vector space with a low dimension. For representative instance: Like this example, the models generate word vectors that could calculate word meaning by arithmetic operations for other vectors. Features The following models to capture the word vectors are supported in *wego*: Word2Vec: Distributed Representations of Words and Phrases and their Compositionality [[pdf]]( GloVe: Global Vectors for

Word Representation [[pdf]]( LexVec: Matrix Factorization using Window Sampling and Negative Sampling for Improved Word Representations [[pdf]]( Also, wego provides nearest neighbor search tools that calculate the distances between word vectors and find the nearest words for the target word. "near" for word vectors means "similar" for words. Please see the Usage section if you want to know how to use these for more details. Inspired by Data Science in Go @chewxy Installation Use command to get this pkg. Usage

*wego* provides CLI and Go SDK for word embeddings. CLI , and executes the workflow to generate word vectors: 1. Build a dictionary for vocabularies and count word frequencies by scanning a given corpus. The execution time depends on the size of the corpus, the hyperparameters (flags), and so on. Save the words and their vectors as a text file. and are the commands which are related to nearest neighbor searching for the trained word vectors. outputs similar words against a

given word using sing word vectors which are generated by the above models. : *wego* does not reproduce word vectors between each trial because it adopts HogWild! algorithm which updates the parameters (in this case word vector) async. is for REPL mode to calculate the basic arithmetic operations ( and ) for word vectors. Go SDK It can define the hyper parameters for models by functional options. The models have some methods: Formats As training word vectors wego requires the following file formats

for inputs/outputs. Input Input corpus must be subject to the formats to be divided by space between words like text8. Output After training *wego* save the word vectors into a txt file with the following format ( is the dimension for word vectors you given):

常见问题

记录了多少星标和分叉?

ynqa/wego 有 508 个星标和 45 个分叉。

仓库排名是多少?

ynqa/wego 排名第 18,146。

记录的语言和类别是什么?

ynqa/wego 有 508 个星标,语言为 Go,类别为 Model Development。

哪个仓库排名最接近?

ynqa/wego 与 shrubb/box-convolutions 比较,后者排名第 18,145,有 508 个星标。

README

Word Embeddings in Go

wego is the implementations from scratch for word embeddings (a.k.a word representation) models in Go.

What's word embeddings?

Word embeddings make words' meaning, structure, and concept mapping into vector space with a low dimension. For representative instance:

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

Like this example, the models generate word vectors that could calculate word meaning by arithmetic operations for other vectors.

Features

The following models to capture the word vectors are supported in wego:

  • Word2Vec: Distributed Representations of Words and Phrases and their Compositionality [pdf]

  • GloVe: Global Vectors for Word Representation [pdf]

  • LexVec: Matrix Factorization using Window Sampling and Negative Sampling for Improved Word Representations [pdf]

Also, wego provides nearest neighbor search tools that calculate the distances between word vectors and find the nearest words for the target word. "near" for word vectors means "similar" for words.

Please see the Usage section if you want to know how to use these for more details.

Why Go?

Inspired by Data Science in Go @chewxy

Installation

Use go command to get this pkg.

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

Usage

wego provides CLI and Go SDK for word embeddings.

CLI

Usage:
  wego [flags]
  wego [command]

Available Commands:
  console     Console to investigate word vectors
  glove       GloVe: Global Vectors for Word Representation
  help        Help about any command
  lexvec      Lexvec: Matrix Factorization using Window Sampling and Negative Sampling for Improved Word Representations
  query       Query similar words
  word2vec    Word2Vec: Continuous Bag-of-Words and Skip-gram model

word2vec, glove and lexvec executes the workflow to generate word vectors:

  1. Build a dictionary for vocabularies and count word frequencies by scanning a given corpus.
  2. Start training. The execution time depends on the size of the corpus, the hyperparameters (flags), and so on.
  3. Save the words and their vectors as a text file.

query and console are the commands which are related to nearest neighbor searching for the trained word vectors.

query outputs similar words against a given word using sing word vectors which are generated by the above models.

e.g. wego query -i word_vector.txt microsoft:

  RANK |   WORD    | SIMILARITY
-------+-----------+-------------
     1 | hypercard |   0.791492
     2 | xp        |   0.768939
     3 | software  |   0.763369
     4 | freebsd   |   0.761084
     5 | unix      |   0.749563
     6 | linux     |   0.747327
     7 | ibm       |   0.742115
     8 | windows   |   0.731136
     9 | desktop   |   0.715790
    10 | linspire  |   0.711171

wego does not reproduce word vectors between each trial because it adopts HogWild! algorithm which updates the parameters (in this case word vector) async.

console is for REPL mode to calculate the basic arithmetic operations (+ and -) for word vectors.

Go SDK

It can define the hyper parameters for models by functional options.

model, err := word2vec.New(
	word2vec.Window(5),
	word2vec.Model(word2vec.Cbow),
	word2vec.Optimizer(word2vec.NegativeSampling),
	word2vec.NegativeSampleSize(5),
	word2vec.Verbose(),
)

The models have some methods:

type Model interface {
	Train(io.ReadSeeker) error
	Save(io.Writer, vector.Type) error
	WordVector(vector.Type) *matrix.Matrix
}

Formats

As training word vectors wego requires the following file formats for inputs/outputs.

Input

Input corpus must be subject to the formats to be divided by space between words like text8.

word1 word2 word3 ...

Output

After training wego save the word vectors into a txt file with the following format (N is the dimension for word vectors you given):

   ... 
排名相邻
同类项目