Learning libsvm to classify text (mood)

From the following links I came up with some idea. I want to ask if I am doing this correctly, or am I mistaken. If I'm wrong, please guide me.

Links
Using libsvm to classify text C #
How to use libsvm to classify text?

My way

First, calculate the number of words in each training set.
Create a list for each word.

eg,

sample word count form training set
|-----|-----------|
|     |   counts  |
|-----|-----|-----|
|text | +ve | -ve |
|-----|-----|-----|
|this | 3   | 3   |
|forum| 1   | 0   |
|is   | 10  | 12  |
|good | 10  | 5   |
|-----|-----|-----|

positive learning data

this forum is good

so the set of workouts will be

+1 1:3 2:1 3:10 4:10

that’s all I got from the above links.
Please help me.

+3
source share
2 answers

You are doing it right.

, "+1" - ( "+ ve" ), .

liblinear, .

+4

libshorttext: libshortText

python

0

All Articles