Natural Language Processing, almost always shortened to NLP, is the part of artificial intelligence concerned with getting computers to work with human language. Not programming languages with their strict rules, but the ordinary, messy language people use to write reviews, send messages, ask questions, and talk to each other. This series will take you from that raw, messy text all the way to the large language models behind tools like ChatGPT. This first chapter sets the scene: what NLP is, why it is genuinely hard, and how the whole field fits together.
You use NLP dozens of times a day without noticing. The spam filter that keeps junk out of your inbox is reading and classifying text. Predictive text and autocomplete guess your next word. Search engines interpret what you typed and rank pages by relevance. Translation apps turn one language into another. Voice assistants convert your speech to text and then try to work out what you meant. Customer support chatbots, sentiment dashboards that tell a brand how people feel about it, and the summaries that appear at the top of search results are all NLP. The field went from academic curiosity to something you rely on constantly, and the pace of that shift is why it is worth learning now.
Computers are excellent with structured, unambiguous data. Human language is the opposite, and that mismatch is the central challenge of NLP. A few of the reasons:
The history of NLP is essentially the story of better and better ways to handle these problems.
NLP tasks split loosely into two halves. Natural Language Understanding (NLU) is about getting meaning out of text: classifying a review as positive or negative, pulling the names of people and places out of an article, or working out what a question is asking. Natural Language Generation (NLG) is about producing text: writing a summary, translating a sentence, or answering in fluent prose. Modern systems often do both at once. A chatbot understands your message (NLU) and then writes a reply (NLG).
Most classical NLP systems follow the same broad pipeline, and it is a useful map for this whole series:
Modern deep learning models blur some of these steps together, but the mental model still holds, and knowing it makes everything that follows easier to place.
NLP has moved through three broad eras. The first was rule-based: linguists hand-wrote grammar rules and dictionaries. This was precise where it worked but brittle, because no one can write rules for every sentence a person might produce. The second was statistical and machine learning based: instead of hand-written rules, systems learned patterns from large collections of text, which is where techniques like the bag-of-words and TF-IDF representations we will cover come from. The third and current era is deep learning, where neural networks learn rich representations of language directly, leading first to word embeddings and then to the Transformer architecture that powers today's large language models.
That last step connects directly to the Neural Networks and Deep Learning series, and especially its chapter on Transformers and attention, because modern NLP and modern deep learning are now essentially the same story. When you later want to put these models to work on your own documents, that path leads to building retrieval-augmented systems.
Before any libraries, here is the most basic possible NLP operation: taking a sentence apart into words. It is crude, but it shows what every NLP system does first, turn a string into units it can count and process.
text = "NLP lets computers read, understand, and respond to human language."
# The simplest possible tokenization: split on spaces
tokens = text.lower().split()
print(tokens)
# ['nlp', 'lets', 'computers', 'read,', 'understand,', 'and', 'respond', 'to', 'human', 'language.']
print("Number of tokens:", len(tokens))
# Number of tokens: 10
Look closely and you can already see a problem: "read," and "language." still have punctuation stuck to them, and "NLP" lost its capitalisation. Deciding how to handle exactly these issues is what the next chapter is about. In real projects you would reach for libraries built for this: NLTK and spaCy for classical NLP, scikit-learn for the machine learning, and Hugging Face Transformers for modern models. We will use each at the right time.
Every NLP system begins by cleaning and splitting raw text into units it can work with. That step, deceptively simple and quietly important, is the subject of the next chapter on text preprocessing, tokenization, stemming, and lemmatization.
Sign in to join the discussion and post comments.
Sign in