Skip to content

Repository files navigation

🧠 NLP Complete Guide

A structured, hands-on walkthrough of classical Natural Language Processing — from raw text to a trained classifier — built as a personal study reference and portfolio artifact.

Python Jupyter NLTK spaCy scikit--learn Status

📖 Table of Contents

🔍 Overview

This repository is a topic-by-topic study log covering classical/traditional NLP — before deep learning enters the picture. Each notebook pairs a plain-language explanation of a concept with runnable code, moving from cleaning raw text, through feature extraction and word embeddings, to a full text-classification pipeline and part-of-speech tagging. It's a study reference rather than a packaged library: expect notebook-style exploratory code, not a production module.

It's the NLP counterpart to Deep-Learning-Complete-Guide, a companion repo in the same "complete guide" series.

📚 Notebooks

# Notebook Topics Covered
01 Text Preprocessing Lowercasing, HTML/URL removal, punctuation removal, chat-word normalization, Ekphrasis social-text cleaning, spelling correction (TextBlob), stop-word removal, emoji handling, word/sentence tokenization, stemming (Porter), lemmatization (WordNet), NLTK vs. spaCy
02 Feature Extraction Corpus/vocabulary/document terminology, One-Hot Encoding, Bag of Words, N-grams, TF-IDF, hand-crafted text features
03 Word2Vec Word embeddings, Word2Vec via gensim, pretrained vector loading
04 Text Classification End-to-end pipeline: CountVectorizer features, RandomForestClassifier, GaussianNB, train/test split, accuracy and confusion matrix
05 POS Tagging Part-of-speech tagging and dependency visualization with spaCy (displacy)

Supporting reference diagrams (visual notes, not rendered by any notebook): Bag of Words Example.png, TF-IDF Diagram.png, Summary important NLP feature extraction techniques.png.

🛠️ Tech Stack

Classical NLP tooling only — no deep learning frameworks (no PyTorch/TensorFlow/ transformers); embeddings go through gensim's Word2Vec and classification through scikit-learn.

Category Tools
Tokenization / normalization NLTK, spaCy (en_core_web_sm)
Text cleanup TextBlob (spelling correction), Ekphrasis (social-media text)
Word embeddings gensim (Word2Vec)
Feature extraction & modeling scikit-learn (CountVectorizer, TfidfVectorizer, RandomForestClassifier, GaussianNB)
Data handling pandas, numpy
Utilities emoji, wget

🗂️ Data

Two CSVs are included for the classification/preprocessing notebooks:

  • IMDB Review.csv — despite the filename, this is not the standard IMDB movie-review sentiment dataset. Its columns (Review_ID, Game_Title, Sentiment_Label, Review_Text) and contents (tweets about entities like Borderlands, Amazon, Microsoft) match the Twitter Entity Sentiment Analysis dataset on Kaggle.
  • twitter_validation.csv — the validation split of that same dataset.

⚙️ Getting Started

pip install pandas numpy nltk spacy textblob ekphrasis emoji gensim wget scikit-learn jupyter

python -m spacy download en_core_web_sm
python -m nltk.downloader stopwords punkt wordnet

Then open any notebook with Jupyter/JupyterLab and run cells top to bottom:

jupyter notebook

Notebooks were written independently as topic-by-topic notes rather than one linear pipeline, but 01 → 05 roughly follows a learning order: cleaning → features → embeddings → classification → POS tagging.

⚠️ Known Issues

  • 01 Text Preprocessing.ipynb loads a dataset via pd.read_csv('IMDB Dataset.csv'), but no file with that name exists in this repo — only IMDB Review.csv is present, and (per the note above) it isn't the same dataset that filename implies. Running that cell as written raises FileNotFoundError. Left unmodified rather than guessed at, since either the notebook's dataset reference or the committed CSV needs to change, and it isn't clear which was originally intended.

🔗 Related Work

📄 Status & License

Active personal reference/learning collection, not a maintained package — expect exploratory notebook code rather than tested, production-ready modules. Shared for educational and portfolio purposes.

About

A structured, hands-on walkthrough of classical NLP: text preprocessing, feature extraction (BoW/TF-IDF), Word2Vec embeddings, text classification, and POS tagging — using NLTK, spaCy, and scikit-learn.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages