hanlp.word2vecTrain: word2vec training.

Description Usage Arguments Author(s) Examples

Description

A function of word2vec training .

Usage

1
2
3
4
5
hanlp.word2vecTrain(file_path = NULL, model_path = "word2vec",
  word_vectors_size = 128L, num_iters = 10L, word_min_freq = 5L,
  window_size = 5L, neg_sample = 5L, type = "skipgram",
  alpha = ifelse(type == "skipgram", 0.05, 0.025), softmax = TRUE,
  threads_num = 2L)

Arguments

file_path

Corpus file path .

model_path

Word2vec mode saving path.

word_vectors_size

Word vector size ,default 128.

num_iters

Number of iterations,default 10.

word_min_freq

This will discard words that appear less than <int> times; default is 5

window_size

Max skip length between words; default is 5.

neg_sample

Negative sample number,default 5.

type

skipgram or cbow model, default skipgram.

alpha

the starting learning rate; default is 0.025 for skipgram and 0.05 for cbow.

threads_num

the threads number default 2.

Author(s)

qxde01

Examples

1
2
3
4
## Not run: 
hanlp.word2vecTrain(file_path='text.txt',model_path = 'word2vec.txt')

## End(Not run)

qxde01/RHanLP documentation built on May 13, 2019, 8:39 a.m.