as.lm_topic_labels {topiclabels} | R Documentation |
lm_topic_labels object
Description
Constructor for lm_topic_labels objects used in this package.
Usage
as.lm_topic_labels(
x,
terms,
prompts,
model,
params,
with_token,
time,
model_output,
labels
)
is.lm_topic_labels(obj, verbose = FALSE)
Arguments
x |
[ |
terms |
[ |
prompts |
[ |
model |
[ |
params |
[ |
with_token |
[ |
time |
[ |
model_output |
[ |
labels |
[ |
obj |
[ |
verbose |
[ |
Details
If you call as.lm_topic_labels
on an object x
which already is of
the structure of a lm_topic_labels
object (in particular a lm_topic_labels
object itself), the additional arguments id, param, ...
may be used to override the specific elements.
Value
[named list
] lm_topic_labels
object.
Examples
## Not run:
token = "" # please insert your hf token here
topwords_matrix = matrix(c("zidane", "figo", "kroos",
"gas", "power", "wind"), ncol = 2)
obj = label_topics(topwords_matrix, token = token)
obj$model
obj_modified = as.lm_topic_labels(obj, model = "It is possible to modify individual entries")
obj_modified$model
obj_modified$model = 3.5 # example for an invalid modification
is.lm_topic_labels(obj_modified, verbose = TRUE)
obj_manual = as.lm_topic_labels(terms = list(c("zidane", "figo", "kroos"),
c("gas", "power", "wind")),
model = "manual labels",
labels = c("Football Players", "Energy Supply"))
## End(Not run)