How do i use custom stopwords filter in Java Weka Api?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I am using Java Weka-api to build classification model. I can use builtin stopwords filter however, i need to use custom filter for my problem. I do not how to use custom stopwords filter in java wake-api. Thanks in advance for your support.
classification java weka
New contributor
Radia Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
1
down vote
favorite
I am using Java Weka-api to build classification model. I can use builtin stopwords filter however, i need to use custom filter for my problem. I do not how to use custom stopwords filter in java wake-api. Thanks in advance for your support.
classification java weka
New contributor
Radia Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am using Java Weka-api to build classification model. I can use builtin stopwords filter however, i need to use custom filter for my problem. I do not how to use custom stopwords filter in java wake-api. Thanks in advance for your support.
classification java weka
New contributor
Radia Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I am using Java Weka-api to build classification model. I can use builtin stopwords filter however, i need to use custom filter for my problem. I do not how to use custom stopwords filter in java wake-api. Thanks in advance for your support.
classification java weka
classification java weka
New contributor
Radia Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Radia Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Radia Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 4 hours ago
![](https://lh4.googleusercontent.com/-SPF11O1e1Co/AAAAAAAAAAI/AAAAAAAAAAA/ABtNlbAG-dBm8m6yHO3ausmBZQAHJ3DXQw/mo/photo.jpg?sz=32)
![](https://lh4.googleusercontent.com/-SPF11O1e1Co/AAAAAAAAAAI/AAAAAAAAAAA/ABtNlbAG-dBm8m6yHO3ausmBZQAHJ3DXQw/mo/photo.jpg?sz=32)
Radia Karim
82
82
New contributor
Radia Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Radia Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Radia Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
You could add your source codes with question for better understanding. Anyway you try the following code.
import weka.core.converters.ConverterUtils.DataSource;
import weka.filters.unsupervised.attribute.StringToWordVector;
import weka.core.Instances;
Instances data = DataSource.read(".../document.txt"); //Your document .
filter.setInputFormat(data);
StringToWordVector filter = new StringToWordVector();
filter.setStopwords(new File(".../stopwords.txt")); //stop words file.
Instances data = Filter.useFilter(data,filter);
You can also read the following document for better understanding weka-api for Java.
http://weka.sourceforge.net/doc.stable/
New contributor
Howa Begum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I appreciate your support. Thanks a lot. Your code and the link of the document really help me lot.
â Radia Karim
3 hours ago
add a comment |Â
up vote
1
down vote
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.
New contributor
Rejaul Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I appreciate your support.
â Radia Karim
4 hours ago
I am very new in Java weka-api programming. I do not understand clearly. Anyone please provide me little more elaborate answer. Thanks in advance for your support.
â Radia Karim
3 hours ago
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
You could add your source codes with question for better understanding. Anyway you try the following code.
import weka.core.converters.ConverterUtils.DataSource;
import weka.filters.unsupervised.attribute.StringToWordVector;
import weka.core.Instances;
Instances data = DataSource.read(".../document.txt"); //Your document .
filter.setInputFormat(data);
StringToWordVector filter = new StringToWordVector();
filter.setStopwords(new File(".../stopwords.txt")); //stop words file.
Instances data = Filter.useFilter(data,filter);
You can also read the following document for better understanding weka-api for Java.
http://weka.sourceforge.net/doc.stable/
New contributor
Howa Begum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I appreciate your support. Thanks a lot. Your code and the link of the document really help me lot.
â Radia Karim
3 hours ago
add a comment |Â
up vote
1
down vote
accepted
You could add your source codes with question for better understanding. Anyway you try the following code.
import weka.core.converters.ConverterUtils.DataSource;
import weka.filters.unsupervised.attribute.StringToWordVector;
import weka.core.Instances;
Instances data = DataSource.read(".../document.txt"); //Your document .
filter.setInputFormat(data);
StringToWordVector filter = new StringToWordVector();
filter.setStopwords(new File(".../stopwords.txt")); //stop words file.
Instances data = Filter.useFilter(data,filter);
You can also read the following document for better understanding weka-api for Java.
http://weka.sourceforge.net/doc.stable/
New contributor
Howa Begum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I appreciate your support. Thanks a lot. Your code and the link of the document really help me lot.
â Radia Karim
3 hours ago
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
You could add your source codes with question for better understanding. Anyway you try the following code.
import weka.core.converters.ConverterUtils.DataSource;
import weka.filters.unsupervised.attribute.StringToWordVector;
import weka.core.Instances;
Instances data = DataSource.read(".../document.txt"); //Your document .
filter.setInputFormat(data);
StringToWordVector filter = new StringToWordVector();
filter.setStopwords(new File(".../stopwords.txt")); //stop words file.
Instances data = Filter.useFilter(data,filter);
You can also read the following document for better understanding weka-api for Java.
http://weka.sourceforge.net/doc.stable/
New contributor
Howa Begum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
You could add your source codes with question for better understanding. Anyway you try the following code.
import weka.core.converters.ConverterUtils.DataSource;
import weka.filters.unsupervised.attribute.StringToWordVector;
import weka.core.Instances;
Instances data = DataSource.read(".../document.txt"); //Your document .
filter.setInputFormat(data);
StringToWordVector filter = new StringToWordVector();
filter.setStopwords(new File(".../stopwords.txt")); //stop words file.
Instances data = Filter.useFilter(data,filter);
You can also read the following document for better understanding weka-api for Java.
http://weka.sourceforge.net/doc.stable/
New contributor
Howa Begum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Howa Begum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered 3 hours ago
![](https://lh5.googleusercontent.com/-wrqtGNytTl8/AAAAAAAAAAI/AAAAAAAAAAA/ABtNlbBa1QghYPV8AC8IQNRB0256FsyS5w/mo/photo.jpg?sz=32)
![](https://lh5.googleusercontent.com/-wrqtGNytTl8/AAAAAAAAAAI/AAAAAAAAAAA/ABtNlbBa1QghYPV8AC8IQNRB0256FsyS5w/mo/photo.jpg?sz=32)
Howa Begum
334
334
New contributor
Howa Begum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Howa Begum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Howa Begum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I appreciate your support. Thanks a lot. Your code and the link of the document really help me lot.
â Radia Karim
3 hours ago
add a comment |Â
I appreciate your support. Thanks a lot. Your code and the link of the document really help me lot.
â Radia Karim
3 hours ago
I appreciate your support. Thanks a lot. Your code and the link of the document really help me lot.
â Radia Karim
3 hours ago
I appreciate your support. Thanks a lot. Your code and the link of the document really help me lot.
â Radia Karim
3 hours ago
add a comment |Â
up vote
1
down vote
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.
New contributor
Rejaul Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I appreciate your support.
â Radia Karim
4 hours ago
I am very new in Java weka-api programming. I do not understand clearly. Anyone please provide me little more elaborate answer. Thanks in advance for your support.
â Radia Karim
3 hours ago
add a comment |Â
up vote
1
down vote
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.
New contributor
Rejaul Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I appreciate your support.
â Radia Karim
4 hours ago
I am very new in Java weka-api programming. I do not understand clearly. Anyone please provide me little more elaborate answer. Thanks in advance for your support.
â Radia Karim
3 hours ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
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.
New contributor
Rejaul Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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.
New contributor
Rejaul Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Rejaul Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered 4 hours ago
![](https://lh6.googleusercontent.com/-TGd0Ibe3TKo/AAAAAAAAAAI/AAAAAAAAACE/E-pS-xuJqXM/photo.jpg?sz=32)
![](https://lh6.googleusercontent.com/-TGd0Ibe3TKo/AAAAAAAAAAI/AAAAAAAAACE/E-pS-xuJqXM/photo.jpg?sz=32)
Rejaul Karim
586
586
New contributor
Rejaul Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Rejaul Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Rejaul Karim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I appreciate your support.
â Radia Karim
4 hours ago
I am very new in Java weka-api programming. I do not understand clearly. Anyone please provide me little more elaborate answer. Thanks in advance for your support.
â Radia Karim
3 hours ago
add a comment |Â
I appreciate your support.
â Radia Karim
4 hours ago
I am very new in Java weka-api programming. I do not understand clearly. Anyone please provide me little more elaborate answer. Thanks in advance for your support.
â Radia Karim
3 hours ago
I appreciate your support.
â Radia Karim
4 hours ago
I appreciate your support.
â Radia Karim
4 hours ago
I am very new in Java weka-api programming. I do not understand clearly. Anyone please provide me little more elaborate answer. Thanks in advance for your support.
â Radia Karim
3 hours ago
I am very new in Java weka-api programming. I do not understand clearly. Anyone please provide me little more elaborate answer. Thanks in advance for your support.
â Radia Karim
3 hours ago
add a comment |Â
Radia Karim is a new contributor. Be nice, and check out our Code of Conduct.
Radia Karim is a new contributor. Be nice, and check out our Code of Conduct.
Radia Karim is a new contributor. Be nice, and check out our Code of Conduct.
Radia Karim is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f40784%2fhow-do-i-use-custom-stopwords-filter-in-java-weka-api%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password