Corpus
Before a model learns anything about language, somebody has to decide which language it will ever see. A corpus is that decision made concrete: a collection of text, assembled on purpose, that serves as the data a system is built from and measured against.
More than a pile of files
What separates a corpus from a heap of scraped pages is deliberate construction — what was included, in what proportion, and what is recorded about it:
- Raw corpora carry text only; annotated corpora add human labels — part-of-speech tags, entity spans, parse trees — which is what makes supervised training possible at all.
- Parallel corpora pair the same content across languages, as Europarl does with EU proceedings, and are the foundation of translation systems.
- Metadata travels with the text — genre, date, author, licence — and a balanced corpus such as the Brown Corpus samples genres to a fixed quota instead of taking whatever was easiest to collect.
The corpus decides the system
A model knows exactly the language its corpus contained. Train a sentiment classifier on product reviews, run it on clinical notes, and accuracy collapses: vocabulary, sentence length and conventions have all changed. Skew the collection and the skew is learned. It is also why splits must be drawn carefully — near-duplicate documents leaking between training and test make results look better than they are. The collections in daily use run from Wikipedia dumps and Common Crawl to the annotated Penn Treebank and the datasets distributed through Hugging Face.
Why it matters
Vocabulary coverage, bias, benchmark scores and the limits of what a model generalises to are inherited from the corpus rather than from the architecture — which is why the first useful question about any language system is what text it was built on.
A corpus is a structured collection of text or transcribed speech assembled for linguistic analysis or model training, with documented sampling, encoding and licensing, and sometimes with annotation layers such as part-of-speech tags or parse trees. It is the empirical base of the field: vocabulary, frequency statistics, embeddings and trained models all inherit the genre, register and bias of the corpus behind them.
Think of a wildlife photographer building a record of the birds in a region. Photographing every bird is impossible, so you choose your locations carefully and collect a set of pictures that fairly represents what is out there.
A corpus is that collection, made of language instead of photographs — thousands or millions of real sentences gathered from news reports, novels, product reviews, phone-call transcripts or medical notes. Software learns how people actually write and speak from these collections, not from a rulebook. That makes the choice of what goes in enormously important. A system built only from newspapers will stumble over slang, and one built only from English will be lost in Hindi.