Test if word is member of word embedding or encoding
Test to determine if words are members of a word embedding.
Load a pretrained word embedding using the
fastTextWordEmbedding function. This function requires Text Analytics Toolbox™ Model for fastText English 16 Billion Token Word Embedding support package. If this support package is not installed, then the function provides a download link.
emb = fastTextWordEmbedding
emb = wordEmbedding with properties: Dimension: 300 Vocabulary: [1×999994 string]
Test if the words
"fastTextWordEmbedding" are in the word embedding.
words = ["I" "love" "fastTextWordEmbedding"]; tf = isVocabularyWord(emb,words)
tf = 1×3 logical array 1 1 0
emb— Input word embedding
Input word embedding, specified as a
enc— Input word encoding
Input word encoding, specified as a
words— Input words
Input words, specified as a string vector, character vector, or cell array of character
vectors. If you specify
words as a character vector, then the
function treats the argument as a single word.