1
$\begingroup$

Creating a classifier to do "Sentiment Analysis" can be done with several algorithms like SVM, KNN, Neural networks,Decision tree...

and lately i have read about Decision tree and how it works and i would like to ask if someone can provide me with an explanation and a conceptual representation of how the decision tree will be created to tackle this problem, and what/how attributes will placed in the nodes of the tree to classify a sentiment of a text as positive|negative|neutral ?

any help would be appreciated, and thanx.

$\endgroup$
1
$\begingroup$

Decision trees are supervised methods, so they need to be trained on some annotated data. Thus the general idea is the same as for any text classification: given a set of documents (for instance represented as TFIDF vectors) together with their labels, the algorithm will calculate which how much each word correlates with a particular label.

For instance it might find that the word "excellent" often appears in documents labeled as positive, whereas the word "terrible" mostly appears in negative documents. By combining all such observations it builds a model able to assign a label to any document.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.