semanticfa-package: semanticfa: Semantic Factor Analysis of Language Model...

semanticfa-packageR Documentation

semanticfa: Semantic Factor Analysis of Language Model Embeddings

Description

Recovers the latent factor structure of a psychological scale from the meaning of its item wording — no human response data required. It embeds item text with a language model, turns the embeddings into an item-by-item similarity matrix, and runs exploratory factor analysis, with a suite of tools for inspecting and refining the scale.

Main entry point

  • sfa — run the full pipeline (embed -> similarity -> retention -> extraction -> diagnostics) and return an "sfa" object with print, summary, plot, and as_psych methods.

Building blocks

  • sfa_embed, sfa_install_python — turn item text into embeddings.

  • sfa_similarity — similarity transforms / encodings (atomic, atomic-reversed, SQuID, mean-centered Pearson).

  • sfa_parallel, sfa_nfactors, sfa_dimselect — choose the number of factors and which embedding dimensions to use.

Item- and scale-level tools

  • sfa_anchor — item-by-construct belonging (a semantic loading table).

  • sfa_redundancy — detect near-duplicate items.

  • sfa_simplify — build response-free short forms.

  • sfa_project — place items on a named bipolar axis (e.g. mild -> severe).

  • sfa_jinglejangle — compare whole scales for jingle/jangle fallacies.

  • sfa_nli_matrix — valence-aware (entailment vs. contradiction) similarity.

  • sfa_congruence — compare the recovered structure to theory or empirical data.

Example data

big5 — IPIP Big-Five 50-item markers with precomputed embeddings, used throughout the examples.

Author(s)

Authors:

See Also

Useful links:


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