How do I use a custom stopwords filter in the Java Weka API? I am using the Java Weka API to build a classification model. I can use the builtin stopwords filter. However, I need to use a custom filter for my problem. I do not know how to use a custom stopwords filter in the Java Weka API.
First of all you have to prepare a text file for your custom stopwords. Then you can use the following code:

import weka.filters.unsupervised.attribute.StringToWordVector;

StringToWordVector filter = new StringToWordVector(10000);
filter.setStopwords(new File(".../stopwords.txt"));


Hope it will help you.