RE: [Classifier4j-devel] How do I train it?
Status: Beta
Brought to you by:
nicklothian
From: Nick L. <nl...@es...> - 2003-11-11 05:52:06
|
> -----Original Message----- > From: moedusa [mailto:mo...@in...] > Sent: Tuesday, 11 November 2003 7:46 AM > To: cla...@li... > Subject: [Classifier4j-devel] How do I train it? > > > Hi! I am playing with classifier4j now, and one thing is > confusing me: > let's say I want to train C4J this way: feed it with some > text (a fiew > paragraphs) and category id, but I can not figure out how to > implement > this now... Looks like I must parse text to words, filter > them and train > it word-by-word now... Is it right, or there is another way and my > understanding of training such things is completely wrong? > > Philipp. > You don't need to train word-by-word, you can just use the ITrainableClassifier.teachMatch(String) and teachNonMatch(String) methods (See <http://classifier4j.sourceforge.net/apidocs/net/sf/classifier4J/ITrainable. html#teachMatch(java.lang.String)>). If you want to use non-default categories then there are version of teachMatch & teachNonMatch that take a category, too. Have you looked at the code for the demos, in particular net.sf.classifier4J.demo.Trainer (<http://cvs.sourceforge.net/viewcvs.py/classifier4j/Classifier4J-Optional/s rc/java/net/sf/classifier4J/demo/Trainer.java?view=markup>)? Let me know if that doesn't make things clearer. Nick |