Description Usage Format Details Usage Methods Author(s) Examples
a R6 class of word Vector Model.
1 |
R6Class
object.
A R6class of wordVectorModel .
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)
|
$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).
qxde01
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.