similar_texts: Returns 'similar' texts to user given strings

Description Usage Arguments Value Examples

View source: R/similar_texts.R

Description

Use to return semantically similar texts from one or severeal user-defined texts.

Usage

1
2
3
similar_texts(texts, texts_id, strings, num_texts, Term_count_min,
  Skip_gram_window, Word_vectors_size, X_max, N_iter,
  xprt_txt_vctrs = TRUE)

Arguments

texts

The texts given by the user to classify later.

strings

A vector of strings to be feed into the model.

num_texts

The number of texts to be returned for each user-given string.

Term_count_min

GloVe parameter.

Skip_gram_window

GloVe parameter.

Word_vectors_size

GloVe parameter.

X_max

GloVe parameter.

N_iter

GloVe parameter.

xprt_txt_vctrs

Defaults to TRUE. Returns a list with the text vectors computed by the GloVe model to be reused again to feed for more strings.

texts_ids

The text_ids in the text to output nice clean format.

Value

A list with dataframes of similiar texts for each string. If text_vectors == TRUE, an additional list is added to the end of list containing the text vectors of the model to used by similar_texts_lite() function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
similar_texts(texts = df$text,
              texts_id = df$text_id,
              strings = mystrgs,
              num_texts = 5,
              Term_count_min = 5,
              Skip_gram_window = 10,
              Word_vectors_size = 100,
              X_max = 10,
              N_iter = 8,
              xprt_txt_vctrs = TRUE
              )

jcgonzalez14/textwhiz documentation built on Aug. 26, 2020, 9:39 a.m.