0

因此,我们在一组15k推文上运行多项式朴素贝叶斯分类算法。我们首先根据Weka的StringToWordVector函数将每条推文分解为一个词特征向量。然后我们将结果保存到一个新的arff文件中作为我们的训练集。我们用另一组5k推文重复此过程,并使用从我们的训练集中派生出的相同模型重新评估测试集。如何从Weka文本分类中输出生成的文档

我们想要做的是输出weka分类在测试集中的每个句子及其分类......我们可以看到一般信息(精确度,召回率,f分数)的性能和准确性该算法,但我们无法看到weka分类的单个句子,基于我们的分类器...是否有反正这样做?

另一个问题是,最终我们的教授会给我们20K多的推文,并期望我们对这个新文档进行分类。我们不知道如何做到这一点,但作为:

All of the data we have been working with has been classified manually, both the training and test sets... 
however the data we will be getting from the professor will be UNclassified... How can we 
reevaluate our model on the unclassified data if Weka requires that the attribute information must 
be the same as the set used to form the model and the test set we are evaluating against? 

感谢您的任何帮助!

回答

1

完成这些任务的最简单方法是使用FilteredClassifier。这种分类器集成了一个Filter和一个Classifier,所以你可以连接一个StringToWordVector过滤器与你喜欢的分类器(J48,NaiveBayes,无论),你将永远保持原始训练集(未处理的文本),并应用分类器通过使用由StringToWordVector过滤器派生的词汇表来发送到新的推文(未处理)。

您可以在“Command Line Functions for Text Mining in WEKA”的命令行中通过“A Simple Text Classifier in Java with WEKA”中的程序查看如何执行此操作。

+0

谢谢,我会试试这个! – Gthoma2