word_dims: Calculates word2vec dimension estimates

Description Usage Arguments Value Examples

View source: R/word2vec.R

Description

Calculates word2vec dimension estimates

Usage

1
2
3
word_dims_newtext(lda_model, text, n_iter = 20)

word_dims(text, n = 10, n_iter = 20)

Arguments

lda_model

A pretrained LDA model from text2vec.

text

Input data. Should be character vector.

n_iter

Integer, number of sampling iterations.

n

Integer, determines the number of latent topics.

Value

A tibble data frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
trump_tweets <- c(
"#FraudNewsCNN #FNN https://t.co/WYUnHjjUjg",
"TODAY WE MAKE AMERICA GREAT AGAIN!",
paste("Why would Kim Jong-un insult me by calling me \"old,\" when I would",
      "NEVER call him \"short and fat?\" Oh well, I try so hard to be his",
      "friend - and maybe someday that will happen!"),
paste("Such a beautiful and important evening! The forgotten man and woman",
      "will never be forgotten again. We will all come together as never before"),
paste("North Korean Leader Kim Jong Un just stated that the \"Nuclear",
      "Button is on his desk at all times.\" Will someone from his depleted and",
      "food starved regime please inform him that I too have a Nuclear Button,",
      "but it is a much bigger &amp; more powerful one than his, and my Button",
      "works!")
)
word_dims(trump_tweets)

textfeatures documentation built on Sept. 4, 2019, 1:05 a.m.