svmlight | R Documentation |
The svmlight data format is an input format used by Mallet.
svmlight(x, ...) ## S4 method for signature 'DocumentTermMatrix' svmlight(x, filename, verbose = TRUE)
x |
Input object, 'DocumentTermMatrix' for the time being. |
... |
Additional arguments. |
filename |
Path to a file. |
verbose |
A 'logical' value, whether to output progress messages. |
Note that it is (currently) not possible to generate a (Mallet) 'InstanceList' from svmlight input that can be used for Mallet topic modelling: The Mallet output from svmlight input is a 'FeatureVector', but Mallet topic modelling requires a 'FeatureSequence' as input.
library(polmineR) use("RcppCWB") svmlight_file <- tempfile() corpus("REUTERS") %>% as.DocumentTermMatrix(p_attribute = "word", s_attribute = "id") %>% svmlight(filename = svmlight_file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.