textPCA: Compute 2 PCA dimensions of the word embeddings for...

View source: R/4_2_textPlotPCA.R

textPCAR Documentation

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

Description

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

Usage

textPCA(words, word_types_embeddings = word_types_embeddings_df, seed = 1010)

Arguments

words

Word or text variable to be plotted.

word_types_embeddings

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 word_embeddings for the individual words that is used for the plotting in the textPCAPlot function.

See Also

see textPCAPlot

Examples

## Not run: 
# Data
df_for_plotting2d <- textPCA(
  words = Language_based_assessment_data_8$harmonywords,
  word_types_embeddings = word_embeddings_4$word_types
)
df_for_plotting2d

## End(Not run)

text documentation built on Aug. 9, 2023, 5:08 p.m.