# Natural language processing

> The field of AI that works with human language: reading, writing, translating.

- Level: Intermediate
- Topics: AI
- URL: https://tidbit.legios.com.ar/natural-language-processing/
- In Spanish: [Procesamiento del lenguaje natural](https://tidbit.legios.com.ar/es/natural-language-processing/)

**Natural language processing** (NLP) is the branch of AI that deals with human language, the 'natural' kind we speak and write, as opposed to programming languages. Its goal is to get computers to do useful things with text and speech: translate it, summarize it, answer questions about it, sort it, or turn it into a spoken reply.

Language is hard for machines because meaning depends on context. 'The movie was not bad' is mildly positive, even though it contains the word 'bad'. 'Bank' can be a river or a place for money. For decades, NLP relied on grammar rules written by linguists, then on statistics over large collections of text. Since the late 2010s it has been dominated by neural networks, especially the **transformer**, and today's large language models are its most visible product.

Classic NLP tasks are still everywhere, often hidden: spam filters, autocomplete on your phone, machine translation, voice assistants that turn speech into text, search engines that understand what you meant, systems that read thousands of customer reviews and tell a company which ones are angry. Many of these tasks that used to need a separate specialized model can now be done by one general language model with the right prompt.

## An analogy

NLP is to computers what learning a second language is to people: first memorizing grammar rules, then picking up patterns from lots of reading, and finally getting a feel for sarcasm and context.

## Keep in mind

- Covers translation, summarizing, classifying, search and speech.
- Hard because the same words change meaning with context.
- Moved from hand-written rules to statistics to neural networks.
- Large language models are the current, most general form of NLP.

## Go deeper

- [Natural language processing on Wikipedia](https://en.wikipedia.org/wiki/Natural_language_processing)
- [What is NLP? (IBM)](https://www.ibm.com/think/topics/natural-language-processing)

## Related terms

- [Artificial intelligence](https://tidbit.legios.com.ar/artificial-intelligence/): Getting computers to do things that, until recently, only people could do.
- [Programming language](https://tidbit.legios.com.ar/programming-language/): A precise, written language people use to give instructions to a computer.
- [Neural network](https://tidbit.legios.com.ar/neural-network/): A pile of tiny math units that learns patterns from examples.
- [Transformer](https://tidbit.legios.com.ar/transformer/): The neural network design behind modern language models, built around 'attention'.
- [Spam](https://tidbit.legios.com.ar/spam/): Unwanted messages sent in bulk: ads, scams and junk you never asked for.
- [LLM](https://tidbit.legios.com.ar/llm/): A neural network trained on huge amounts of text to predict the next word.
- [Prompt](https://tidbit.legios.com.ar/prompt/): Everything you send to an AI model: the question, the instructions, the context.
