cue_sim: Compute similarity vector between a cue word and all words in...

Description Usage Arguments Value

View source: R/cue_sim.R

Description

Compute similarity vector between a cue word and all words in the vocabulary of an embeddings model

Usage

1
cue_sim(cue, embeds, method = "cosine", norm = "l2", rank = FALSE)

Arguments

cue

cue word for which similarity vector will be computed

embeds

embeddings model (V by D matrix)

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"

rank

logical value indicating whether to return a vector of similarities or ranks

Value

a numeric vector of cosine similarities (or ranks if indicated) between all words in the vocabulary and the cue word


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