Description Usage Arguments See Also
View source: R/layer-text_vectorization.R
This method sets the vocabulary and DF data for this layer directly, instead
of analyzing a dataset through adapt()
. It should be used whenever the vocab
(and optionally document frequency) information is already known. If
vocabulary data is already present in the layer, this method will either
replace it, if append
is set to FALSE
, or append to it (if 'append' is set
to TRUE
)
1 2 | set_vocabulary(object, vocab, df_data = NULL, oov_df_value = FALSE,
append = FALSE)
|
object |
a text vectorization layer |
vocab |
An array of string tokens. |
df_data |
An array of document frequency data. Only necessary if the layer output_mode is "tfidf". |
oov_df_value |
The document frequency of the OOV token. Only necessary if output_mode is "tfidf". OOV data is optional when appending additional data in "tfidf" mode; if an OOV value is supplied it will overwrite the existing OOV value. |
append |
Whether to overwrite or append any existing vocabulary data. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.