embed_description: Generate an Embedding of a Description

Description Usage Arguments Value See Also Examples

View source: R/visit_embeddings.R

Description

Compute a simple average of embeddings of given terms of a description. Only terms that have embeddings are included. If there are not such terms, the vector of NA is returned.

Usage

1
embed_description(description, term_vectors)

Arguments

description

A string of concatenated terms extracted from a visit, separated by ", "

term_vectors

A matrix of embeddings of the terms

Value

A vector of the embedding of the description.

See Also

embed_visit, embed_list_visits

Examples

1
2
3
4
5
6
7
8
term_vectors <- embed_terms(interviews, embedding_size = 10L,
  term_count_min = 1L)

embed_description("fever", term_vectors)
embed_description("fever, cough", term_vectors)
embed_description("fever, cough, temperature",
                  term_vectors)
embed_description("temperature", term_vectors)

adamgdobrakowski/memr documentation built on Sept. 4, 2021, 3:45 a.m.