Jordan Reyes

Associate Professor, Computational Linguistics

Reproducible corpus pipelines

A shared workflow for building, versioning and citing linguistic corpora. This page explains why we wrote it down, how it is organised and what changed once colleagues began to use it.

Author

Published

Four grey metal doors set in a red corrugated metal wall
Demo image. Replace it with your own.

A corpus is only as trustworthy as the steps that produced it. This project describes a common way of collecting, cleaning, versioning and citing language data, so that a result can be traced back to its source months or years later.

The problem with corpora

Anyone who has worked with a corpus knows the feeling of opening a folder and finding five files with similar names. Which one was used for the paper? Which cleaning script produced it? The answers often live in a single person’s memory, and that person may have moved on to another university.

Curved glass office towers with a grid facade, in black and white

The consequences are practical. Results cannot be reproduced, small corrections cannot be traced and students inherit data they do not dare to touch. In a field that depends on shared resources, this quiet disorder costs a great deal of time and occasionally leads to errors that survive into print.

Our aim was not to invent a new technology. Good tools for versioning and automation already exist. What was missing was an agreed way of using them for linguistic data, with its odd file formats, its privacy limits and its habit of growing in unpredictable directions.

We started by interviewing a dozen colleagues about how they actually worked. Almost nobody followed a documented process, yet almost everybody had a private method that worked for them. The aim was to find the common core of these methods and to write it down in a form that a newcomer could pick up on the first day.

A beige storefront wall with one white door, two windows and a lamp post

A workflow in four steps

The workflow has four stages: collect, clean, annotate and release. Each stage has its own folder, its own short description and a script that can be run from a single command. Raw files are never edited by hand. Every change happens in a script, so that the path from source to result is a sequence that anyone can follow.

Versioning is handled by tagging a release whenever the corpus changes in a way that could affect an analysis. A release has a number, a date and a short note describing what is different. Analyses name the release they used, and a reader can fetch exactly that release rather than whatever happens to be current.

Quality checks run automatically at each stage. They look for missing files, unexpected characters, empty transcripts and annotation labels that are not on the agreed list. The checks are simple, but they catch mistakes at the moment they are made, which is when they are cheapest to fix.

A glass sphere holding a road, crossed by red and blue streaks of light

Documentation lives next to the data, not in a separate system. Every folder contains a short plain-text description of what is inside, where it came from and which script touched it last. These descriptions are checked together with the files, and a release cannot be published if one of them is missing or visibly out of date.

Citing and sharing

Credit matters in academic work, and corpora are often built by people who never appear on the resulting papers. The workflow therefore includes a plain citation file that names the compilers, the annotators and the funders, and gives a recommended way of referring to each release.

Sharing depends on the data. Some corpora can be published openly, others only with a licence, and some only inside a secure environment. The workflow does not hide these differences. Each release states its conditions in a short, readable summary at the top, and the scripts refuse to publish files marked as restricted.

Silhouettes of three grain silos against a starry dusk sky

We encourage groups to deposit the scripts even when the data cannot be shared. A reader who cannot see the corpus can still see how it was built, and this alone often settles questions about how a surprising number came about.

Persistent identifiers complete the picture. Each release receives a stable reference that continues to work even if the repository moves, and the citation file points to it. A reader who finds the reference in a paper years later should reach the same files, and we test this by following a handful of older references each year.

The corner of a granite building with arched windows

What changed in practice

After a year of use in several groups, the clearest change is cultural. People now write a short description before they begin a new collection, and they discuss file names in the first meeting rather than the last. New students are productive sooner because the structure of a project is familiar from the start.

There have been costs too. Writing scripts for tasks that used to be done by hand is slower at first, and some colleagues found the discipline irritating. We responded by providing templates and examples, and by acknowledging that a rigid process applied to a small, one-off study is not always worth the effort.

The workflow is still young, and we expect to revise it. Suggestions are welcome, especially from groups working with formats that we have not yet met. A shared practice improves only when it is tested against many different projects.

A cactus in front of a pink wall and an orange wall under a blue sky

A last point concerns scale. Small corpora benefit from the workflow almost as much as large ones, because the cost of confusion is similar, but they have fewer people to carry it. We have therefore tried to keep the minimum version very light, with a folder layout, one script per stage and a single release note.

Advice for newcomers

If you are about to start a corpus, begin by writing a one-page description of what you want to collect, why, and who will be allowed to use it. This page costs an hour and saves weeks. It also turns out to be the first thing that reviewers, partners and funders ask to see, and it is easy to keep updated as plans change.

Next, choose names for files and folders and stick to them. Use plain letters, avoid spaces and put the date in a fixed position. This advice sounds trivial, but it is the most common source of confusion we have seen, and it costs nothing to follow from the very first file onward, even in a small and temporary project.

A granite facade with arched windows and a carved cornice

Finally, release early and release often, even if a release is only a few days old. Frequent small releases make mistakes easier to find, give collaborators something solid to cite and teach the whole group that a corpus is never finished, only carefully described at a particular moment in its life.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *