{"id":32929208,"url":"https://github.com/imran-sony/sentiment-analysis-imdb","last_synced_at":"2026-05-13T20:31:46.700Z","repository":{"id":322296769,"uuid":"1088931570","full_name":"imran-sony/sentiment-analysis-imdb","owner":"imran-sony","description":"Sentiment Analysis of IMDB Review Dataset","archived":false,"fork":false,"pushed_at":"2025-11-03T17:03:32.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-03T19:09:08.723Z","etag":null,"topics":["beautifulsoup","bert-embeddings","gensim","nltk","pytorch","tf-idf","transformers","word2vec-embeddinngs"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imran-sony.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-03T16:48:18.000Z","updated_at":"2025-11-03T17:12:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/imran-sony/sentiment-analysis-imdb","commit_stats":null,"previous_names":["imran-sony/sentiment-analysis-imdb"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/imran-sony/sentiment-analysis-imdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imran-sony%2Fsentiment-analysis-imdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imran-sony%2Fsentiment-analysis-imdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imran-sony%2Fsentiment-analysis-imdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imran-sony%2Fsentiment-analysis-imdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imran-sony","download_url":"https://codeload.github.com/imran-sony/sentiment-analysis-imdb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imran-sony%2Fsentiment-analysis-imdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32999186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beautifulsoup","bert-embeddings","gensim","nltk","pytorch","tf-idf","transformers","word2vec-embeddinngs"],"created_at":"2025-11-11T11:16:25.119Z","updated_at":"2026-05-13T20:31:46.695Z","avatar_url":"https://github.com/imran-sony.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎬 Sentiment Analysis on IMDB Dataset\n\nThis project compares three different text-representation techniques — **TF-IDF, Word2Vec, and BERT embeddings** — for sentiment classification on the IMDB movie reviews dataset using Logistic Regression as the classifier.\n\n## 📚 Project Overview\n\nThe goal is to evaluate how classical and modern NLP techniques perform on sentiment analysis tasks.\nWe use:\n\n**TF-IDF** → traditional statistical feature representation\n\n**Word2Vec** → word embeddings capturing semantic meaning\n\n**BERT (DistilBERT)** → transformer-based contextual embeddings\n\nEach representation is trained and evaluated using Logistic Regression, and results are compared using standard classification metrics.\n\n\n## 🧠 Workflow\n### 1️⃣ Load Dataset\n\nThe IMDB dataset is used from the datasets library:\n\nfrom datasets import load_dataset\ndataset = load_dataset('imdb')\n\n\nThe dataset is automatically split into train and test sets.\n\n### 2️⃣ Preprocessing\n\nSteps include:\n\nLowercasing\n\nRemoving HTML tags\n\nRemoving punctuation and numbers\n\nTokenization with NLTK\n\nStopword removal\n\n### 3️⃣ Feature Extraction Methods\n🔹 TF-IDF\n\nRepresent text as numerical vectors using term frequency–inverse document frequency.\n\nTrained with Logistic Regression.\n\n\n🔹 Word2Vec\n\nTrain a Word2Vec model on tokenized text.\n\nRepresent each document as the average of its word vectors.\n\n\n🔹 BERT (DistilBERT)\n\nUse DistilBERT embeddings for contextual representation.\n\nExtract token embeddings from the last hidden state.\n\n\n### 4️⃣ Classification\n\nA Logistic Regression classifier is trained on each feature representation.\n\n\n### 5️⃣ Evaluation Metrics\n\nEvaluate performance using:\n\nAccuracy\n\nPrecision\n\nRecall\n\nF1-score\n\n## 📊 Comparison\n![Comparison](./Comparison.png)\n\n## 🧩 Technologies Used\n\nPython\n\nPyTorch\n\nHugging Face Transformers\n\nscikit-learn\n\nNLTK\n\nGensim\n\nBeautifulSoup\n\nDatasets Library\n\n\n## 🚀 How to Run\n\nClone this repository:\n\ngit clone https://github.com/imran-sony/sentiment-analysis-imdb.git  \ncd sentiment-analysis-imdb  \n\nor open IMDB.ipynb\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimran-sony%2Fsentiment-analysis-imdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimran-sony%2Fsentiment-analysis-imdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimran-sony%2Fsentiment-analysis-imdb/lists"}