semanticfa: Semantic Factor Analysis of Language Model Embeddings

Performs exploratory factor analysis on language model embeddings of psychological scale items. Embeds item text with sentence transformers or other language models, transforms the embeddings into item-by-item similarity matrices, and extracts latent factor structure via standard exploratory factor analysis, using several similarity transforms (atomic reversed, SQuID centering, mean-centered Pearson) and fit diagnostics tailored to embedding matrices (TEFI, RMSR, CAF, McDonald's omega). Factor retention spans embedding-adapted parallel analysis, the empirical Kaiser criterion, Velicer's minimum average partial, a comparison-data misfit profile, and a calibrated learned rule that reports conformal intervals. Further tools orient factor axes toward retrieved construct terms by lexical target rotation, and audit whether a scale's items cover their construct's semantic region without collecting responses. The underlying methods are documented with full citations in the corresponding function help pages. Returns objects compatible with 'psych' and 'EFAtools' workflows.

Package details

AuthorDevon Yanitski [aut, cre] (ORCID: <https://orcid.org/0009-0006-1568-3387>), Chris Westbury [aut]
MaintainerDevon Yanitski <dyanitsk@ualberta.ca>
LicenseGPL (>= 3)
Version0.5.0
URL https://github.com/devon7y/semanticfa
Package repositoryView on CRAN
Installation Install the latest version of this package by entering the following in R:
install.packages("semanticfa")

Try the semanticfa package in your browser

Any scripts or data that you put into this service are public.

semanticfa documentation built on Sept. 2, 2026, 1:07 a.m.