【问题标题】:How to output resultant documents from Weka text-classification如何从 Weka 文本分类中输出结果文档
【发布时间】:2014-06-06 03:30:32
【问题描述】:

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

我们想要做的是输出weka在测试集中分类的每个句子及其分类......我们可以看到性能和准确率的一般信息(Precision,recall,f-score)算法,但我们看不到由 weka 分类的单个句子,基于我们的分类器......有没有办法做到这一点?

另一个问题是,最终我们的教授会给我们多 2 万条推文,并期望我们对这个新文档进行分类。但是,我们不确定如何执行此操作:

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?

感谢您的帮助!

【问题讨论】:

    标签: machine-learning weka sentiment-analysis text-classification


    【解决方案1】:

    完成这些任务的最简单方法是使用FilteredClassifier。这种分类器集成了FilterClassifier,因此您可以将StringToWordVector 过滤器与您喜欢的分类器(J48NaiveBayes 等)连接起来,您将始终保持原始训练集(未处理的文本),并使用StringToWordVector 过滤器派生的词汇将分类器应用于新推文(未处理)。

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

    【讨论】:

    • 谢谢,我试试看!
    猜你喜欢
    • 2015-01-12
    • 2016-03-11
    • 2017-06-26
    • 2018-06-10
    • 2012-03-22
    • 2012-07-27
    • 1970-01-01
    • 2012-05-10
    • 2015-01-03
    相关资源
    最近更新 更多