Built to order

Sentiment Analysis using LSTM

This project trains a BiLSTM on the Sentiment140 corpus — 1.6 million tweets labeled by distant supervision — to score the sentiment of reviews and tweets. A demo app renders an animated sentiment gauge and highlights the cue words driving each score. The signature experiment is cross-domain: the tweet-trained model is tested on IMDB reviews, documenting the domain-shift drop. The training notebook logs accuracy, F1 and the confusion matrix, so every report metric comes from the student's own build. Suitable for B.E./B.Tech final-year projects in Computer Science, AI/ML and Data Science.

Chat on WhatsApp — get a quotation

Sentiment Analysis using LSTM - project prototype demo screenshot
More project photos (3)

The problem

Every product launch, movie release and policy announcement is followed by a flood of online opinion that no human team can read in full. Sentiment analysis turns that flood into a signal — positive, negative or mixed — that brands, researchers and analysts can act on. Tweets are short, noisy and informal: exactly the text where word order and context decide meaning, which is why recurrent networks outperform bag-of-words baselines on them. This project builds that system as a complete student build: a BiLSTM over GloVe embeddings trained on the large-scale Sentiment140 tweet corpus, wrapped in a demo that scores any pasted text and highlights its cue words. The build's signature is intellectual honesty — the same model is evaluated on IMDB movie reviews, and the report documents the cross-domain accuracy drop as its domain-shift experiment instead of hiding it.

SYSTEM FLOW

4 components 5 connections

Live flow
Drag to explore
100%
userUser

Pastes text to score and explores cue-word highlights.

How it works

  1. Sentiment140 tweets are cleaned (URLs, mentions and hashtags normalized), lowercased, tokenized and padded or truncated to 100 tokens; a balanced sample is used for reproducible training.
  2. Tokens are embedded with pre-trained GloVe 100-d vectors and fed to a bidirectional LSTM (128 units per direction) with dropout, followed by a dense sigmoid head.
  3. The network trains with Adam and binary cross-entropy for about 10 epochs with early stopping on validation loss.
  4. Every epoch logs accuracy, loss, precision, recall and F1; the best checkpoint is kept and evaluated on held-out tweets.
  5. The same trained model is evaluated on IMDB movie reviews to measure the cross-domain accuracy drop — the domain-shift experiment.
  6. The demo app scores pasted text, renders the sentiment gauge and colors the positive/negative cue words.

Tech stack:

  • Python 3.10, TensorFlow/Keras (Bidirectional LSTM)
  • GloVe 100-d pre-trained word embeddings
  • pandas, NumPy (preprocessing), scikit-learn (metrics)
  • Matplotlib (accuracy/loss curves)
  • Sentiment140 dataset (1.6M tweets); IMDB 50k reviews (cross-domain eval)
  • Single-file HTML/CSS/JS demo app (analyzer, dataset, training views)
Parameter Value
Model BiLSTM-128 over GloVe 100-d embeddings + dense sigmoid head
Datasets Sentiment140: 1.6M tweets (distant supervision); IMDB: 50k reviews (cross-domain test)
Input English review/tweet text, tokenized to 100-token sequences
Output Sentiment score (0–100%), negative/neutral/positive label, cue-word highlights
Training ~10 epochs, Adam, binary cross-entropy, early stopping
Evaluation Accuracy, precision, recall, F1, confusion matrix — computed by the notebook on your build
Design targets ≈ 82–85% on held-out tweets; ≈ 70–75% cross-domain on IMDB

Project features

  • [Sentiment scoring] Any pasted review or tweet scored on a negative–neutral–positive scale with an animated gauge and confidence readout.
  • [Word-cue highlighting] Positive and negative cue words are colored by their contribution, making each prediction inspectable.
  • [BiLSTM classifier] Bidirectional LSTM (128 units per direction) over pre-trained GloVe 100-d embeddings with dropout and a sigmoid head.
  • [Distant-supervision pipeline] Trains on Sentiment140's 1.6M emoticon-labeled tweets with documented preprocessing (URL/mention stripping, normalization, 100-token padding).
  • [Cross-domain experiment] The tweet-trained model is evaluated on IMDB's 50k movie reviews; the measured drop is reported as the domain-shift finding.
  • [Full evaluation logging] Accuracy, precision, recall, F1 and the confusion matrix on held-out tweets and on IMDB — computed during the build, never pre-claimed.
  • [Preprocessing controls] Tokenization, vocabulary size and sequence-length settings exposed in the notebook for experimentation.

What is included

  • Complete source code (preprocessing, embedding setup, BiLSTM training, evaluation, demo app)
  • Jupyter training and evaluation notebook (buyer-run procedure: preprocess, train, evaluate, cross-domain test)
  • Project report PDF (background, distant supervision, methodology, evaluation, domain-shift analysis)
  • PPT presentation for final review
  • Viva Q&A preparation document (RNNs/LSTMs, embeddings, distant supervision, domain shift, evaluation metrics)
  • Setup guide (environment, dataset download, GloVe vectors, training, running the demo)

Advantages

  • Sentiment scoring: any pasted review or tweet scored on a negative–neutral–positive scale with an animated gauge and confidence readout.
  • Word-cue highlighting: positive and negative cue words are colored by their contribution, making each prediction inspectable.
  • BiLSTM classifier: bidirectional LSTM (128 units per direction) over pre-trained GloVe 100-d embeddings with dropout and a sigmoid head.
  • Distant-supervision pipeline training on Sentiment140's 1.6 million emoticon-labeled tweets with documented preprocessing (URL/mention stripping, normalization, 100-token padding).
  • Cross-domain experiment: the tweet-trained model is evaluated on IMDB's 50k movie reviews, and the measured drop is reported as the domain-shift finding.
  • Full evaluation logging of accuracy, precision, recall, F1 and the confusion matrix on held-out tweets and on IMDB, with tokenization, vocabulary size and sequence-length settings exposed in the notebook.

Disadvantages

  • Sentiment140 labels come from emoticons (distant supervision), so roughly 1 in 10 training labels is noisy by construction, and the report states this openly.
  • Sarcasm ("great, another delay — love it"), code-mixed text and negation-heavy sentences are known failure modes, documented in the error analysis.
  • The model does binary sentiment only; multi-aspect reviews ("great food, terrible service") get a single blended score.
  • Cross-domain accuracy on IMDB is expected to be lower than on tweets — that drop is the experiment, not a defect, and the report frames it that way.
  • English informal text only; other languages and scripts are outside the training data.

Limitations & prerequisites

  • Sentiment140 labels come from emoticons (distant supervision), so roughly 1 in 10 training labels is noisy by construction — the report states this openly.
  • Sarcasm ("great, another delay — love it"), code-mixed text and negation-heavy sentences are known failure modes, documented in the error analysis.
  • The model does binary sentiment only; multi-aspect reviews ("great food, terrible service") get a single blended score.
  • Cross-domain accuracy on IMDB is expected to be lower than on tweets — that drop is the experiment, not a defect, and the report frames it that way.
  • English informal text only; other languages and scripts are outside the training data.

Frequently Asked Questions

Which dataset is used?

Sentiment140 (Go, Bhayani & Huang, 2009): 1.6 million tweets with binary labels derived from emoticons — a classic distant-supervision corpus. IMDB's 50,000 movie reviews (Maas et al., 2011) are used for the cross-domain evaluation experiment.

Which model is used?

A bidirectional LSTM (128 units per direction) over pre-trained GloVe 100-dimensional word embeddings, with dropout and a dense sigmoid output head.

Is the accuracy guaranteed?

No. The design targets are ≈ 82–85% on held-out tweets and ≈ 70–75% cross-domain on IMDB, but final performance is measured by the training notebook during your build — the report documents your own numbers.

Why evaluate on IMDB too?

To run an honest domain-shift experiment: a tweet-trained model degrades on long, grammatical movie reviews. Documenting that drop is more credible viva material than a single inflated accuracy number.

What are the main limitations?

Distant-supervision label noise, sarcasm and code-mixed text failures, binary-only output, and the expected cross-domain accuracy drop.

Is this project suitable for a final-year project?

Yes — for Computer Science, AI/ML and Data Science programs. It demonstrates RNNs, word embeddings, distant supervision, evaluation discipline and domain-shift analysis, all strong viva material. Suitable for B.E./B.Tech final-year projects in Computer Science, AI/ML and Data Science.

Components & software requirements
  • Python 3.10, TensorFlow/Keras (Bidirectional LSTM)
  • GloVe 100-d pre-trained word embeddings
  • pandas, NumPy (preprocessing), scikit-learn (metrics)
  • Matplotlib (accuracy/loss curves)
  • Sentiment140 dataset (1.6M tweets); IMDB 50k reviews (cross-domain eval)
  • Single-file HTML/CSS/JS demo app (analyzer, dataset, training views)
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Leveraging a hybrid model for accurate sentiment analysis of Twitter data (BiLSTM + Logistic Regression)

Get a quotation