hanlp.wordVectorModel: word Vector Model.

Description Usage Format Details Usage Methods Author(s) Examples

Description

a R6 class of word Vector Model.

Usage

1

Format

R6Class object.

Details

A R6class of wordVectorModel .

Usage

For usage details see Methods, Arguments and Examples sections.

1
2
3
4
wordVectorModel = hanlp.wordVectorModel$new(model_path)
wordVectorModel$similarity(word1,word2)
wordVectorModel$nearest(word,size=10L)
wordVectorModel$analogy(word1,word2,word3)

Methods

$new(model_path)

Constructor for Global vectors model

$similarity(word1,word2)

Calculating the semantic distance of word1 and word2.

$nearest(word,size=10L)

Find out the size(default 10) words most similar to a word.

$analogy(word1,word2,word3)

Given three words:word1,word2,and word3, the words and their similarity list are returned to the semantic distance of (word1 - word2 + word3).

Author(s)

qxde01

Examples

1
2
3
4
5
6
7
## Not run: 
wordvector<-hanlp.wordVectorModel$new(model_path)
wordvector$similarity('hello','world')
wordvector$nearest("world",size=10L)
wordvector$analogy('R','Python','Java')

## End(Not run)

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