as.textmodel_lss | R Documentation |
Create a new textmodel_lss object from an existing or foreign objects.
as.textmodel_lss(x, ...)
## S3 method for class 'matrix'
as.textmodel_lss(
x,
seeds,
terms = NULL,
slice = NULL,
simil_method = "cosine",
auto_weight = FALSE,
verbose = FALSE,
...
)
## S3 method for class 'numeric'
as.textmodel_lss(x, ...)
## S3 method for class 'textmodel_lss'
as.textmodel_lss(x, ...)
## S3 method for class 'textmodel_wordvector'
as.textmodel_lss(x, seeds, terms = NULL, verbose = FALSE, spatial = TRUE, ...)
x |
an object from which a new textmodel_lss object is created. See details. |
... |
arguments used to create a new object. |
seeds |
a character vector or named numeric vector that contains seed words. If seed words contain "*", they are interpreted as glob patterns. See quanteda::valuetype. |
terms |
a character vector or named numeric vector that specify words
for which polarity scores will be computed; if a numeric vector, words' polarity
scores will be weighted accordingly; if |
slice |
a number or indices of the components of word vectors used to
compute similarity; |
simil_method |
specifies method to compute similarity between features.
The value is passed to |
auto_weight |
automatically determine weights to approximate the polarity of terms to seed words. Deprecated. |
verbose |
show messages if |
spatial |
if |
If x
is a textmodel_lss, original word vectors are reused to compute polarity
scores with new seed words. It is also possible to subset word vectors via slice
if it was trained originally using SVD.
If x
is a dense matrix, it is treated as a column-oriented word vectors with which
polarity of words are computed. If x
is a named numeric vector, the values are treated
as polarity scores of the words in the names.
a dummy textmodel_lss object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.