nlp

Natural language processing tutorials covering text analysis and language tasks in Python.

ML: Sentiment Analysis, Bag-of-Words to ML

Python sentiment analysis lets you build a working analyzer that reads a movie review and tells you whether it is positive or negative. You will clean the raw text, turn words into numbers with TF-IDF (term frequency times inverse document frequency), train a classifier on 2,000 real movie reviews, and score it honestly on reviews it has never seen. No Graphics Processing Unit (GPU), no deep learning, runs in a few seconds on a laptop. “Sentiment analysis is the gateway ... Read More

ML: Naive Bayes, Probabilistic Classification

Python Naive Bayes is one of the fastest ways to build a working classifier, and this guide explains it from the ground up: Bayes’ theorem in plain English, the “naive” independence assumption, the Gaussian, Multinomial, and Bernoulli variants, and why such a simple algorithm still wins at text classification and spam filtering. “Naive Bayes should not work as well as it does. The independence assumption is almost always wrong, yet the classifier is almost always competitive.” Pedro Domingos, The Master ... Read More

Python SQLite: Database and CRUD Operations

Python SQLite gives you a real relational database that lives inside one file, with no server to install and no setup at all. The built-in sqlite3 module lets you create tables and run insert, select, update, and delete queries. You will learn parameterized queries that block SQL (Structured Query Language) injection, plus context managers that commit safely and roll back when something goes wrong. “SQLite is the most used database engine in the world. It is in your phone, your ... Read More