Sentiment Analysis with LatticaAI Demo Tutorial
Last updated
Was this helpful?
Last updated
Was this helpful?
Our Sentiment Analysis model is trained on the . This dataset is a collection of 1.6 million tweets that have been labeled with sentiment polarity- positive or negative, and is commonly used for sentiment analysis and natural language processing tasks.
We trained a logistic regression sentiment classifier using the Term Frequency-Inverse Document Frequency (TF-IDF) approach:
TF-IDF is a numerical representation of text useful for transforming text into a numerical format suitable for machine learning. It measures how important a word is within a document relative to the entire corpus. It consists of:
Term Frequency (TF): The number of times a word appears in a document.
Inverse Document Frequency (IDF): A measure that reduces the weight of commonly occurring words and increases the weight of rare words.
Here is a sample code for inferring sentiment from text using the trained model:
First our client package
See our for a detailed explanation of each step in this flow. To use the image sharpening model use the sentimentAnalysis model ID