kiran
kiran

Reputation: 349

Using WEKA classifier model in Java for classifying real time text

I had used the GUI to train a classifier for some sample arff files . After training I saved the obtained model .

Now that I need to use this model file in my java code to classify some text , could you please tell me how should I proceed ? I dont want to do an evaluation but would like to classify the input text given .

I had gone thru the http://weka.wikispaces.com/Serialization & http://weka.wikispaces.com/Use+Weka+in+your+Java+code .

But still couldn't find code for it .I just got an way to load a model file .But didn't get any clue on classifying text directly to classes . Any help on this regard would be helpfull .

Upvotes: 2

Views: 2500

Answers (2)

PhDeveloper
PhDeveloper

Reputation: 335

See here, similar tutorial by Hidalgo - Java code with slides and textual dataset. It trains a machine, loads the model and classify real time unseen textual data. Very easy to follow https://github.com/drelhaj/MachineLearning

Upvotes: 2

Jose Maria Gomez Hidalgo
Jose Maria Gomez Hidalgo

Reputation: 1061

Although the previously suggested post is very nice, I believe that the one I produced some time ago better fits your needs, as it specifically deals with text, and it is generic regarding the classifier. Please check "A Simple Text Classifier in Java with WEKA".

Upvotes: 2

Related Questions