h2o.findSynonyms: Find synonyms using a word2vec model.

View source: R/w2vutils.R

h2o.findSynonymsR Documentation

Find synonyms using a word2vec model.

Description

Find synonyms using a word2vec model.

Usage

h2o.findSynonyms(word2vec, word, count = 20)

Arguments

word2vec

A word2vec model.

word

A single word to find synonyms for.

count

The top 'count' synonyms will be returned.

Examples

## Not run: 
library(h2o)
h2o.init()

job_titles <- h2o.importFile(
    "https://s3.amazonaws.com/h2o-public-test-data/smalldata/craigslistJobTitles.csv", 
    col.names = c("category", "jobtitle"), col.types = c("String", "String"), header = TRUE
)
words <- h2o.tokenize(job_titles, " ")
vec <- h2o.word2vec(training_frame = words)
h2o.findSynonyms(vec, "teacher", count = 20)

## End(Not run)

h2o documentation built on May 29, 2024, 4:26 a.m.