| sfa_project | R Documentation |
Places each item on a continuous scale defined by two opposing text poles (Grand et al. 2022). An axis is built as the direction from a "low" pole to a "high" pole (e.g. mild -> severe, passive -> active); every item is then projected onto that line. Unlike factor grouping (which says which construct an item belongs to), projection says where along a named dimension the item falls — useful for checking that a scale's items span a full range of intensity/severity, ordering items, or locating items on an interpretable axis.
sfa_project(
x,
axes,
normalize = TRUE,
pole_embeddings = NULL,
embed = NULL,
model = NULL
)
x |
An |
axes |
A named list of axes. Each element defines the two poles, as
either a named character vector |
normalize |
Logical. If |
pole_embeddings |
Optional named list (one entry per axis) of precomputed
pole embeddings, each a list with |
embed, model |
Embedding backend/model for the pole text. Default to the
backend/model recorded on |
This uses the cosine of each item against the pole-difference axis (a length-normalized variant of Grand et al.'s raw inner-product projection), so scores are comparable across items of differing embedding norm. As in Grand et al., a bipolar (two-pole) axis is what gives a diagnostic direction; a single pole is far less informative.
An object of class "sfa_projection": a list with the
item-by-axis scores matrix, the axis definitions, and normalize.
Grand, G., Blank, I. A., Pereira, F., & Fedorenko, E. (2022). Semantic projection recovers rich human knowledge of multiple object features from word embeddings. Nature Human Behaviour, 6(7), 975–987. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1038/s41562-022-01316-8")}
sfa_anchor
data(big5)
fit <- sfa(
data.frame(code = big5$codes, item = big5$items,
factor = big5$factors, scoring = big5$scoring),
embeddings = big5$embeddings, scoring = big5$scoring, nfactors = 5)
# project items onto a neuroticism -> extraversion axis using precomputed poles
poles <- list(NtoE = list(
low = big5$embeddings[big5$factors == "Neuroticism", ],
high = big5$embeddings[big5$factors == "Extraversion", ]))
pr <- sfa_project(fit, axes = list(NtoE = c(low = "neurotic", high = "extraverted")),
pole_embeddings = poles)
head(round(pr$scores, 2))
## Not run:
# with a live embedding backend, name the poles in words and they are embedded:
sfa_project(fit, axes = list(severity = c(low = "mild", high = "severe")))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.