Large Language Model (LLM) Tools for Psychological Text Analysis

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. .


LLMing

The goal of LLMing is to generate and assess psychological text data.

Installation

You can install the development version of LLMing from GitHub with:

# install.packages("pak")
pak::pak("sliplr19/LLMing")

Example

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")

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("LLMing")

1.3.0 by Lindley Slipetz, a month ago


https://github.com/sliplr19/LLMing


Report a bug at https://github.com/sliplr19/LLMing/issues


Browse source code at https://github.com/cran/LLMing


Authors: Lindley Slipetz [aut, cre] , Teague Henry [aut] , Siqi Sun [ctb]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports Rdpack, quanteda, stopwords, stringi, dbscan, pracma, stats, quanteda.1, stopwords.1, stringi.1, utils, caret, word2vec, keras3

Suggests testthat

System requirements: Python (>= 3.10) with packages: torch, transformers, pandas, numpy


See at CRAN