--- license: other pretty_name: AfroTopics tags: - africa - african-languages - topic-classification - bible - jw - parallel-corpus task_categories: - text-classification multilinguality: - multilingual --- # AfroTopics A topic-classification layer over [`AfriSpeech/africa-corpus`](https://huggingface.co/datasets/AfriSpeech/africa-corpus) (Bible text) and [`AfriSpeech/african-corpus-jw`](https://huggingface.co/datasets/AfriSpeech/african-corpus-jw) (JW.org publications), classifying the English anchor text into a fixed topic taxonomy with Gemini, then propagating the label to every aligned African-language translation via the shared `verse_key`. ## Taxonomy - agriculture - health - governance - economy - education - technology - infrastructure - environment - culture - security Every item is categorized into one of the 10 topics above — there is no `none`/catch-all option. An earlier pass allowed a `none` label for content with no clear real-world subject matter (narrative, genealogy, poetry, fragments, captions); on review that made the dataset less useful, so those items were re-classified with `none` removed from the label set, forcing a best-fit real-topic decision even where the fit is loose (e.g. Genesis 1's creation narrative → `environment`). Any remaining un-reclassified items were filtered out, ensuring that 100% of items in the published dataset carry a concrete topic label. ## Structure - `bible/english_bible.csv` — `verse_key, eng, topic` (28711 verses) - `bible/{iso1}_{iso3}.csv` — `verse_key, local, topic`, one file per high-resource Bible-corpus language (23 languages) - `jw/english_jw.csv` — `verse_key, eng, topic` (386427 paragraphs) - `jw/{Name}_{code}.csv` — `verse_key, local, topic`, one file per JW-corpus African language (135 languages) The Bible and JW portions use different key namespaces (`BOOK.chapter.verse` vs `docid#pid`) and are kept as separate files rather than merged. ## Method 1. Pulled the English anchor text (`english_cache.csv`) from each source dataset. 2. For the Bible corpus, classified verses with Gemini (`gemini-2.5-flash`). 3. For the JW corpus, first restricted to paragraphs that have at least one African-language parallel translation anywhere in the corpus (paragraphs with zero parallels can't be used for a parallel dataset anyway), then classified those with Gemini (`gemini-2.5-flash-lite`, thinking disabled). 4. Second pass: items labeled `none` in step 2/3 were re-classified with `none` removed from the label set, forcing the model to pick whichever of the 10 real topics fits best. Items not re-classified were omitted so all retained examples carry a valid topical label. 5. Joined the resulting `verse_key -> topic` labels onto each high-resource language's per-language file. 6. For Bible-corpus languages with multiple available translation versions, picked the single largest/most-complete version (preferring standard script over alternate-script variants, e.g. Latin-script Hausa over the Arabic-script edition). ## Caveats - Labels are LLM judgments on the **English** text only, not human-validated, and not verified against the African-language text itself — treat them as weak/silver labels. A meaningful fraction were forced best-fit choices on content with no strong real-world topical grounding (narrative, genealogy, fragments) — see the taxonomy note above. - An earlier attempt classified this data with a pure sentence-embedding nearest-neighbor approach (`BAAI/bge-large-en-v1.5` against category description embeddings); it was abandoned after inspection showed low, non-discriminating confidence scores and frequent misclassification of fragments/captions. Gemini was used instead for both corpora. - Category distribution is uneven and reflects the source material: Bible narrative skews toward `culture` and `security` (religious/war content); JW literature covers the other topics more evenly but still skews toward `culture`. ## Source & license Bible text is derived from public Bible translations via YouVersion (see `AfriSpeech/africa-corpus` for terms). JW text is an alignment index over publicly accessible jw.org pages, content (c) Watch Tower Bible and Tract Society of Pennsylvania (see `AfriSpeech/african-corpus-jw` for terms). This repository's own contribution (the topic labels and the joined structure) is released under the same terms as the two source datasets.