Naive Bayes classifier for sentiment analysis of tweets

8 views (last 30 days)
I'm currently working on a project where I'm using tweets to predict deriative prices. My tweet data is a time series containing datetime, tweet text, etc.
Originally I wanted to start with the Naive Bayes classifier method using the Statisitics and Machine Learning Toolbox to predict the sentiment of a new tweet. However I found that the example does not fit the data, which contains strings with the tweets and not numerical variables.
I did manage to perform the SVM and Convolutional Neural Network, since the examples where more applicable to my data.
Does anyone know how to apply the Naive Bayes Classifier to a sentiment analysis?
Thanks
Frank

Answers (1)

Hritika Suneja
Hritika Suneja on 31 Dec 2020
You cannot use Naive Bayes classifier directly on your text data as the input to NaiveBayes classifier needs to be a numeric matrix.You will have to preprocess your text data using text analytic techniques such as tokenization and word encodings which will convert your text data to numeric sequnce which can be used for further classification. Please refer to the following documentation link which gives more details about different techniques for preprocessing the data : https://www.mathworks.com/products/text-analytics.html. Hope it helps !

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!