Sentiment Analysis with LatticaAI Demo Tutorial

Overview of the Model

Our Sentiment Analysis model is trained on the Sentiment140 Kaggle datasetarrow-up-right. 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:

file-download
168KB
dictionary containing the vocabulary and the IDF scores
file-download
39KB
file-download
136B

Achieving Full Privacy with LatticaAI

circle-info

First install our client package

circle-info

See our step-by-step guide for a detailed explanation of each step in this flow. To use the image sharpening model use the sentimentAnalysis model ID

Last updated