A collection of large language model (LLM) text analysis methods
designed with psychological data in mind. Currently, LLMing (aka "lemming")
includes a text anomaly detection method based on the angle-based subspace
approach described by Zhang, Lin, and Karim (2015) and a text generation method.
The goal of LLMing is to generate and assess psychological text data.
You can install the development version of LLMing from GitHub with:
# install.packages("pak")
pak::pak("sliplr19/LLMing")
This is a basic example which shows you how to get BERT embeddings:
library(LLMing)
#>
#> Attaching package: 'LLMing'
#> The following object is masked from 'package:stats':
#>
#> embed
df <- data.frame(
text = c(
"I slept well and feel great today!",
"I saw friends and it went well.",
"I think I failed that exam. I'm such a disapointment."
)
)
emb_dat <-
LLMing::embed(
df,
embed = "word2vec",
text_col = "text")