0

我有一个文本文件(.txt),其中每一行都有一条推文。每条推文都由新行分隔。我想将文件加载到 WEKA,但它只支持 .arff 作为输入。我打算使用一些聚类方法对推文进行聚类,那么如何将文本文件转换为 arff.

这是数据的屏幕截图。 在此处输入图像描述

4

1 回答 1

0

WEKA supports CSV as well. You can convert your text file into a CSV by either code or by hand, I recommend code. Then just import it into WEKA. Once imported, and if you really want, convert it into an .arff.

Just look at how your text file is formatted. Then write a little program that parses the file and puts , commas to separate values. Make sure to leave the headers, WEKA will use them.

于 2014-04-25T19:21:02.223 回答