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
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
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
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
New contributor
New contributor
asked 4 hours ago
Radia Karim
82
82
New contributor
New contributor
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
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
I appreciate 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 |Â
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
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
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
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
New contributor
answered 3 hours ago
Howa Begum
334
334
New contributor
New contributor
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
I appreciate 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 |Â
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
I appreciate 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 |Â
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
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
New contributor
answered 3 hours ago
Rejaul Karim
486
486
New contributor
New contributor
I appreciate 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 |Â
I appreciate 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
I appreciate your support.
â Radia Karim
3 hours ago
I appreciate 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
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