Compute 2 PCA dimensions of the word embeddings for individual words.

textPCA(words, single_wordembeddings = single_wordembeddings_df, seed = 1010)

Arguments

words

Word or text variable to be plotted.

single_wordembeddings

Word embeddings from textEmbed for individual words (i.e., decontextualized embeddings).

seed

Set different seed.

Value

A dataframe with words, their frquency and two PCA dimensions from the wordembeddings for the individual words that is used for the plotting in the textPCAPlot function.

See also

Examples

# Data df_for_plotting2d <- textPCA( words = Language_based_assessment_data_8$harmonywords, single_wordembeddings = wordembeddings4$singlewords_we ) df_for_plotting2d
#> # A tibble: 295 x 4 #> words n Dim_PC1 Dim_PC2 #> <chr> <int> <dbl> <dbl> #> 1 accepting 2 NA NA #> 2 agreeing 1 -0.440 0.282 #> 3 alcohol 1 -1.98 1.85 #> 4 amazed 1 -0.235 1.26 #> 5 amicable 1 -0.0897 -0.561 #> 6 amity 1 -0.844 -1.69 #> 7 amused 1 -1.23 1.65 #> 8 anger 2 NA NA #> 9 angry 2 NA NA #> 10 animals 1 NA NA #> # … with 285 more rows