Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

conText (version 1.4.3)

compute_similarity: Compute similarity vector (sub-function of bootstrap_similarity)

Description

Compute similarity vector (sub-function of bootstrap_similarity)

Usage

compute_similarity(
  target_embeddings = NULL,
  pre_trained = NULL,
  candidates = NULL,
  norm = NULL
)

Value

vector of cosine similarities between alc embedding and nearest neighbor candidates

Arguments

target_embeddings

the target embeddings (embeddings of context)

pre_trained

a V x D matrix of numeric values - pretrained embeddings with V = size of vocabulary and D = embedding dimensions

candidates

character vector defining the candidates for nearest neighbors - e.g. output from get_local_vocab

norm

character = c("l2", "none") - set to 'l2' for cosine similarity and to 'none' for inner product (see ?sim2 in text2vec)