C# 用于情绪分析的LibSVM格式

C# 用于情绪分析的LibSVM格式,c#,c++,svm,libsvm,sentiment-analysis,C#,C++,Svm,Libsvm,Sentiment Analysis,我正在尝试使用libSVM(C++版本)找出我做错了什么 让我们以2行为例来说明我的原始文本文件: positive Wonderful film that mixes documentary and fiction in a way that makes the spectator question: what is the extent of truth in documentary films or is there such a thing as an objective docu

我正在尝试使用libSVM(C++版本)找出我做错了什么

让我们以2行为例来说明我的原始文本文件:

positive    Wonderful film that mixes documentary and fiction in a way that makes the spectator question: what is the extent of truth in documentary films or is there such a thing as an objective documentary.

negative    An unfunny, unworthy picture which is an undeserving end to Peter Sellers' career. It is a pity this movie was ever made.
由此,我将把它转换成我认为应该是正确的libSVM格式: 标签特征:值特征:值

我的标签是0(正)和1(负)

从原始文本到经过处理的文本,我删除了常用的停止词(a,the,…)

从我的理解来看,一个词就是一个特征

如果这句话是第一句话:

Great movie
我将其转换为:

0 1:1 2:1
第100句:

Great actor

0 1:1 234:1
(我以actor的索引234为例)

我所理解的值是一个单词在句子中出现的次数

因此,如果我有:

great great great
我会得到:

0 1:3
这就是我皈依的方式

当我在LibSVM中使用线性文件时,C从1到10(我尝试了10个值,因为我认为它会改变)

事实上,我总是得到完全相同的混淆矩阵和51%的准确率

我需要添加更多步骤吗?改变我转换它的方式

因为最后我有很多特征(单词)(在我的培训文件中超过35k)

我有什么遗漏吗

我还使用C#实现的LibSVM进行了测试,得到了相同的结果

对于数据集,它是imdb()

0 1:3