Building a Setswana–English parallel corpus for machine translation

Machine translation depends on evidence. A system can produce fluent English, yet still mistranslate Setswana grammar, cultural references, idioms, or respectful forms of address when its training data is thin or poorly aligned. A parallel corpus—carefully matched Setswana and English texts—provides the examples needed to develop, test, and improve translation technology.

For Setswana, corpus building has a wider purpose than improving automated translation. It supports dictionary making, terminology development, language teaching, translator training, and the preservation of written and spoken language. It can also make African-language content more visible in digital services used by communities in Botswana, South Africa, Australia, and elsewhere.

An Australian research team might encounter Setswana in universities, multilingual community organisations, migration services, cultural projects, or commercial language work. The practical task is to assemble trustworthy bilingual material, document its origins, align it at useful levels, and evaluate whether a model conveys meaning rather than simply copying familiar word patterns.

What a parallel corpus contributes

A parallel corpus contains source texts and their translations, arranged so that corresponding units can be compared. These units may be aligned by document, paragraph, sentence, phrase, or terminology entry. For machine translation, sentence-aligned data is often the essential starting point, although richer annotation can reveal grammatical and cultural information that a sentence pair alone cannot express.

The corpus should represent real communicative situations rather than a narrow collection of translated exercises. Government information, educational resources, news, literature, religious writing, health communication, legal material, and everyday conversation each contribute different vocabulary and structures. A balanced collection helps prevent a translation model from treating parliamentary language as if it were ordinary speech.

Setswana and English differ in word order, agreement, tense and aspect marking, noun class systems, and the way meaning is distributed across words. A good dataset therefore records more than a Setswana sentence beside an English sentence. It should retain metadata about genre, date, translator, dialect or variety where known, subject area, and whether the translation is human-produced, revised, or machine-generated.

Selecting material with care

The first stage is a collection policy. Researchers should define the intended use, the language varieties included, the domains required, and the quality threshold for translations. Publicly available material can be valuable, yet availability does not automatically mean permission to reproduce it or use it for model training.

Parliamentary records are especially useful because they contain formal debate, recurring terminology, procedural language, and references to public life. A detailed example of the issues involved appears in Setswana parliamentary debates, where the relationship between institutional texts and corpus research is made concrete. Such documents should be collected with stable source information and checked for revisions, missing pages, and inconsistent bilingual formatting.

Literary and community texts add expressive language that official documents often lack. They may contain code-switching, idioms, proverbs, repetitions, and culturally specific references. These features are valuable for evaluation, even when they are difficult for an automated system. Copyright, consent, and licensing need to be settled before distribution, with special care for texts contributed by individuals or community groups.

Aligning meaning across languages

Sentence alignment is rarely a simple matter of matching line one with line one. A single Setswana sentence may be translated by two English sentences, while an English sentence may correspond to a longer Setswana passage. Headings, lists, quoted speech, footnotes, and editorial additions can also disturb the sequence.

Automatic alignment tools can propose matches using sentence length, punctuation, word associations, and multilingual embeddings. Human review remains essential, especially for smaller datasets where a few errors can have a large effect. Each pair should be labelled as aligned, uncertain, partial, or unusable rather than forcing every item into a false one-to-one relationship.

Idioms require particular attention because literal word matching can create misleading training examples. The discussion of translating Setswana idioms highlights why figurative meaning must be recorded deliberately. A parallel corpus can preserve the idiom, its contextual meaning, and the translator’s strategy, allowing later evaluation to distinguish a faithful rendering from a grammatically smooth but culturally empty sentence.

Recording grammar and cultural meaning

Setswana morphology carries information that English may express through separate words or leave implicit. Noun class agreement, subject markers, object markers, negation, and tense or aspect distinctions can be obscured when the data is tokenised without linguistic analysis. Even modest annotation—such as part-of-speech tags, named entities, and clause boundaries—can make the corpus more useful for research.

A lexical database linked to the parallel corpus can record lemma forms, inflected forms, English equivalents, senses, domains, and usage examples. This is especially helpful for words with several meanings or terms whose best translation changes by context. Etymological notes may explain why a borrowed word behaves differently across domains, while terminology records can support consistent translations in health, law, education, and technology.

Historical language contact also deserves attention. A short account of Latin’s influence on Spanish illustrates how inherited, borrowed, and learned vocabulary can develop through sustained contact. Setswana data should similarly distinguish established borrowings, code-switching, calques, and occasional foreign insertions rather than treating every non-Setswana form as noise.

Including speech and community knowledge

Written sources alone cannot represent the full language. Recorded interviews, oral histories, public talks, radio programmes, and community conversations can capture pronunciation, discourse markers, turn-taking, formulaic expressions, and forms of politeness. Transcription should preserve meaningful speech features while avoiding unnecessary personal information.

Work on Setswana elders’ speech demonstrates how a corpus can examine age-related language patterns and culturally grounded expression. For a parallel dataset, recordings should have time-aligned transcripts and translations where possible. Speakers need clear information about storage, access, future research uses, and whether their voices may be used to train language technology.

Australian projects must take consent and privacy seriously. The Privacy Act 1988 may apply to personal information held by an organisation, while state and territory rules can add obligations for health, education, or public-sector data. Research involving Aboriginal and Torres Strait Islander communities also requires culturally appropriate governance; these principles are relevant to any community-led language project, including decisions about who may access recordings and derived datasets.

Designing evaluation for real use

A translation model should be tested on material it has not seen during training. The evaluation set should cover formal and informal registers, different subject areas, idioms, named entities, negation, agreement, and sentences with more than one plausible interpretation. Randomly splitting near-duplicate documents can produce inflated scores, so documents or source collections should usually be separated before training and testing.

Automatic measures such as BLEU, chrF, and COMET can provide useful signals, but they do not replace expert assessment. Reviewers should judge adequacy, fluency, terminology, grammatical agreement, cultural appropriateness, and harmful omissions. A small panel of Setswana speakers and experienced English translators can identify errors that a general metric overlooks.

The Australian market adds practical constraints. A translation tool intended for councils in Melbourne, health services in Sydney, or multilingual customer support must handle privacy, accessibility, procurement, and accountability requirements. NAATI-certified translators may be needed for particular professional contexts, and automated output should be clearly labelled as such where legal or health consequences are possible.

Building sustainable technical infrastructure

A reproducible corpus needs consistent file formats, version control, checksums, and documentation. Text can be stored in UTF-8 with separate metadata files, while audio should retain original recordings alongside compressed access copies. Each sentence pair should have a stable identifier so that corrections, reviews, and model experiments can be traced over time.

Preprocessing should be conservative. Unicode normalisation, whitespace correction, punctuation handling, and duplicate removal are useful, but aggressive cleaning can erase diacritics, discourse markers, or culturally meaningful forms. Tokenisation and subword segmentation should be tested against Setswana morphology; a model that fragments important grammatical units badly may learn less effectively even when the dataset appears large.

Open licensing can encourage reuse, although openness must be balanced with consent and cultural authority. A tiered release may provide unrestricted metadata, controlled access to text, and community-governed access to recordings. In Australia, secure storage, breach response, and contractual restrictions are part of responsible data management, especially when material includes identifiable speakers or sensitive topics.

Connecting corpus work with language services

A parallel corpus becomes more valuable when it serves several linked activities. Lexicographers can use aligned examples to identify senses and collocations. Translators can consult verified terminology and compare alternative renderings. Teachers can create exercises based on authentic language, while developers can build translation memories, spellcheckers, speech tools, and search systems.

Creative translation also deserves a place in the data. The discussion of whether anime titles should be translated literally or creatively in anime title translation shows that translation choices depend on audience, genre, cultural familiarity, and purpose. A corpus should preserve such choices with annotations, rather than ranking one wording as universally correct.

The most effective project is iterative. Begin with a modest, well-documented collection, review alignment manually, train a baseline system, analyse recurring errors, and then gather material that addresses those weaknesses. Each release should state its sources, limitations, language coverage, evaluation results, and known gaps so users can interpret its performance responsibly.

For practical work, start by defining the audience and permitted uses, secure rights and informed consent, collect varied Setswana–English material, align it with human oversight, and preserve metadata at every stage. A smaller corpus with reliable translations, transparent governance, and expert evaluation will provide a stronger foundation for machine translation than a larger archive whose origins and quality cannot be established.