Weka Tutorial 31: Document Classification 1 (Application)
Why Stack Overflow recommends it
Stack Overflow users link it when answering how to turn string attributes or ARFF text data into numeric word vectors for Weka text classification.
Recommended by 2 people across 3 different months, 2015 to 2016.
What it is
A screencast from Rushdi Shams's Weka tutorial series showing how to use the StringToWordVector unsupervised attribute filter to turn document text into word vectors. It covers the first, application-focused step of building a text classification model in Weka. The actual classification work follows in the next video.
What people said
Recommends Rushdi Shams · 2015-02 · Stack Overflow · on “Generate an Arff File for Weka”
You can use Weka's StringToWordVector filter to convert the text into a word vector (but not necessarily a sparse matrix). Take a look at my tutorial [this video] on this.
Recommends cgl · 2015-04 · Stack Overflow · on “Weka ,Text Classification on an arff file”
I found the videos below quite helpful when I first got my hands on text classification using Weka. You might want to take a look. Weka Tutorial 31: Document Classification 1 (Application) [this video] Weka Tutorial 32: Document classification 2 (Application) [LINK] WEKA Text Classification for First Time & Beginner Users [LINK] You might want to use StringToWordVector filter to see the effect of each word as an attribute, which is indeed described in detail in the first and last video . Within the filter settings you can give a stopwords list and choose in each run to use it or not. Same with the stemming you can change it as well. This documentation [LINK] and videos will get you to understand
Recommends Rushdi Shams · 2015-11 · Stack Overflow · on “Altrnative of "Weka: training and test set are not compatible"?”
Given the requirements you mentioned, you can use Weka's Filtered Classifier option during training and testing. I am not re-iterating what I have recorded as a video cast here [this video] and here [LINK] . But the basic idea is not to use the StringToWord vector as a direct filter rather to use it as a filtering option in the FilteredClassifier option. The model you generate will be just once. And then you can apply the model directly on your unlabelled data without retraining them or without applying StringToWord vector again on the unlabelled data. FilteredClassifier will take care of these concerns for you.
Cites xro7 · 2016-09 · Stack Overflow · on “String array attribute in weka”
Your arff file need to be in this format: @Relation testRelation @attribute firstAtr string @attribute secondAtr string @attribute thirdAtr string @attribute yourClass {Deepika Shah, secondClass, ...other classes listed here} @data "Voracious reader","funny"," pretty",Deepika Shah ...more data here Then you can import your arff file in weka. Now you need to trasform String values to numbers. To do that you have to use the weka->unsupervised->attribute->StringToWordVector filter located in Filter section at preprocess tab. You can click on the filter to tune parametres like term representation (tf,tf-idf) ,stopwords, stemmer algorithms, n-grams etc. Then you click apply. After this process is