# Text Extraction

- **Canonical URL:** https://getaimath.com/dictionary/text-extraction/
- **Topics:** [Retrieval-Augmented Generation (RAG)](https://getaimath.com/dictionary/category/retrieval-augmented-generation-rag/)
- **Last updated:** 2026-11-25

## What is Text Extraction?

**In one sentence:** Text extraction is pulling readable text out of files, images or web pages.

For scanned documents, it uses OCR. For web pages, it removes menus and ads to keep the main content.

![RAG (Retrieval-Augmented Generation): The Open-Book Exam — Simple cartoon comparing an AI guessing from memory and making things up versus RAG: 1. Search your real documents, 2. Hand the exact page to the AI, 3. Get a factual answer with a page citation.](https://getaimath.com/diagrams/retrieval-augmented-generation-rag.png)
*Napkin Diagram (Retrieval-Augmented Generation (RAG)): Without RAG, AI answers from blurry memory; with RAG, it opens your real documents to the right page before answering.*

## What is an example of Text Extraction?

Extracting just the article text from a news page and ignoring the sidebar.

## Why does Text Extraction matter?

Clean text extraction leads to better search and answers.

## Related Concepts

- [Document Loading](https://getaimath.com/dictionary/document-loading/): Document loading is bringing documents from sources like folders, websites, databases or apps into an AI system.
- [Chunking](https://getaimath.com/dictionary/chunking/): Chunking splits long documents into smaller pieces before turning them into embeddings for search.
- [Document Parsing](https://getaimath.com/dictionary/document-parsing/): Document parsing is reading files like PDFs, Word documents or web pages and pulling out their content and structure.
- [Embedding Generation](https://getaimath.com/dictionary/embedding-generation/): Embedding generation is turning chunks of text into embeddings using an embedding model.
- [Indexing](https://getaimath.com/dictionary/indexing/): Indexing is organizing documents ahead of time so they can be searched quickly.
- [Vector Index](https://getaimath.com/dictionary/vector-index/): A vector index is a special data structure that organizes embeddings so similar ones can be found quickly.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/text-extraction/)
