For the complete documentation index, see llms.txt. This page is also available as Markdown.

Sentiment Analysis with LatticaAI Demo Tutorial

Overview of the Model

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

dictionary containing the vocabulary and the IDF scores
39KB
Open
136B
Open

Achieving Full Privacy with LatticaAI

First install our client package

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

Was this helpful?