nearest_neighbors: Find the nearest neighbors of a cue given a trained word...

Description Usage Arguments Value Note

View source: R/nearest_neighbors.R

Description

Find the nearest neighbors of a cue given a trained word embedding model

Usage

1
nearest_neighbors(cue, embeds, N = 5, method = "cosine", norm = "l2")

Arguments

cue

cue word for which we want nearest neighbors

embeds

matrix of trained embeddings

N

number of nearest neighbors to return

method

a param of text2vec's sim2: character, the similarity measure to be used. One of c("cosine","jaccard").

norm

a param of text2vec's sim2: character = c("l2","none") - how to scale input matrices. If they already scaled - use "none"

Value

a character vector of nearest neighbors of length N

Note

context the first nearest neighbor will be the cue itself.


prodriguezsosa/weeval documentation built on Aug. 15, 2020, 7:01 a.m.