gpt4 book ai didi

machine-learning - 如何输出 Weka 文本分类的结果文档

转载 作者:行者123 更新时间:2023-11-30 09:56:54 28 4
gpt4 key购买 nike

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

我们想要做的是输出 weka 在测试集中分类的每个句子及其分类...我们可以看到性能和准确度的一般信息(精确度、召回率、f-score)算法,但我们看不到 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?

感谢您的帮助!

最佳答案

完成这些任务的最简单方法是使用 FilteredClassifier 。这种分类器集成了Filter和一个 Classifier ,这样您就可以连接 StringToWordVector使用您喜欢的分类器( J48NaiveBayes 等)进行过滤,并且您将始终保留原始训练集(未处理的文本),并使用由StringToWordVector过滤。

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

关于machine-learning - 如何输出 Weka 文本分类的结果文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23208044/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com