find_rejection: Find the 'rejection matrix' from a semantic vector

View source: R/utils-embedding.R

find_rejectionR Documentation

Find the 'rejection matrix' from a semantic vector

Description

"Reject" each word in a word embedding matrix of D dimension from a vector of D dimensions, extracted from the same embedding space. The vector can be a single word, or a concept vector obtained from get_centroid(), get_direction(), or get_regions().

Usage

find_rejection(wv, vec)

Arguments

wv

Matrix of word embedding vectors (a.k.a embedding model) with rows as words.

vec

Vector extracted from the embeddings

Value

A new word embedding matrix, each row of which is rejected from vector.


text2map documentation built on July 9, 2023, 6:35 p.m.