# AfriSenti-SemEval 2023: Twitter sentiment in African languages (Shared Task 12) The AfriSenti corpus is a set of Twitter posts in African languages, each labelled positive, negative or neutral by native speakers. Most tweets were labelled by three annotators and the final label is the majority vote. For the Ethiopian languages, two annotators labelled each tweet and a third decided. It was released in the GitHub repository of the AfriSenti-SemEval 2023 shared task (SemEval-2023 Task 12). The AfriSenti paper describes more than 110,000 tweets in 14 languages. The tables of this package hold all the Subtask A (monolingual) train, dev and test files, for the 12 languages that have them: Amharic (am), Algerian Arabic (dz), Hausa (ha), Igbo (ig), Kinyarwanda (kr), Moroccan Arabic/Darija (ma), Nigerian Pidgin (pcm), Mozambican Portuguese (pt), Swahili (sw), Xitsonga (ts), Twi (twi) and Yoruba (yo). Oromo and Tigrinya have no Subtask A files in the repository. Each row has a shared-task ID that encodes the language and split (e.g. am_train_00001), the tweet text and its gold label. The paper states that the tweets were anonymised by replacing every @-mention with @user and removing URLs. The dataset was created by Shamsuddeen Hassan Muhammad, Idris Abdulmumin, Seid Muhie Yimam, David Ifeoluwa Adelani, Ibrahim Said Ahmad, Nedjma Ousidhoum, Abinew Ali Ayele, Saif M. Mohammad, Meriem Beloucif, Sebastian Ruder and co-authors. ## At a glance - **Platform:** Twitter (X) - **Tables:** posts (106,828 rows), annotations (106,828 rows) - **Structure:** Labelled data, Text - **Version:** 1.0.0 - **Licence:** CC BY 4.0; SPDX `CC-BY-4.0` ## Contents | Path | What it is | |---|---| | `data/posts.parquet` | The posts table (canonical, Parquet) | | `csv/posts.csv.gz` | The same table as gzip CSV | | `jsonl/posts.jsonl.gz` | The same table as gzip JSON Lines | | `data/annotations.parquet` | The annotations table (canonical, Parquet) | | `csv/annotations.csv.gz` | The same table as gzip CSV | | `docs/upstream/` | The upstream documentation, verbatim | | `original/` | The 39 upstream file(s), byte for byte | | `datapackage.json`, `croissant.json` | Machine-readable descriptions of this package | | `CITATION.cff`, `CITATION.bib` | How to cite | | `LICENSE.md` | Licence and terms | | `manifest-sha256.txt` | SHA-256 checksum of every file | ## Tables and columns ### posts (106,828 rows) Pieces of content people wrote: posts, comments, replies, tweets, messages, reviews. | Column | Type | Meaning | |---|---|---| | `post_id` | string | The shared-task identifier of the tweet: the language code of the file, the split (train, dev or test) and a running number (e.g. am_train_00001, yo_dev_00002). It is not the Twitter status ID. | | `text` | string | The tweet text as released, with @-mentions replaced by @user and URLs removed upstream (some t.co links remain in a few files). Some files are lower-cased or have punctuation removed. Many Amharic test tweets (am_test_*) are wrapped in a pair of single quotes, which are kept as part of the text. | | `x_split` | string | The shared-task split the tweet belongs to (train, dev or test), from the folder its file is in. | | `lang` | string | The tweet's language as a BCP 47 tag, from the language code in its file's name, mapped as the dataset README describes the languages: am Amharic, arq Algerian Arabic (files dz_), ha Hausa, ig Igbo, rw Kinyarwanda (files kr_), ary Moroccan Arabic/Darija (files ma_), pcm Nigerian Pidgin, pt-MZ Mozambican Portuguese (files pt_), sw Swahili, ts Xitsonga, tw Twi (files twi_), yo Yoruba. | ### annotations (106,828 rows) Labels attached to posts, users, threads, links or text spans, by people, models or rules. | Column | Type | Meaning | |---|---|---| | `target_id` | string | The tweet the label belongs to; joins to posts.post_id. | | `label` | string | The gold sentiment label of the tweet: positive, negative or neutral. | ## Quick start Python (pandas): ```python import pandas as pd df = pd.read_parquet("https://echo.directory/download/afrisenti-semeval-2023-twitter-sentiment/v1.0.0/data/posts.parquet") ``` DuckDB (reads over HTTP without downloading the file first): ```sql SELECT * FROM 'https://echo.directory/download/afrisenti-semeval-2023-twitter-sentiment/v1.0.0/data/posts.parquet' LIMIT 10; ``` R (arrow): ```r df <- arrow::read_parquet("https://echo.directory/download/afrisenti-semeval-2023-twitter-sentiment/v1.0.0/data/posts.parquet") ``` ## How this package was made ECHO converted the upstream file(s) listed under `original/` into the tables above, following the [ECHO Data Package 1.0.0](https://echo.directory/docs/edp/1.0/) standard. Every value was checked against the source during conversion: no row was dropped and no value was changed except as described here. - Rows per file (train/dev/test): am 5,984/1,497/1,999; arq 1,651/414/958; ha 14,172/2,677/5,303; ig 10,192/1,841/3,682; rw 3,302/827/1,026; ary 5,583/494/2,961; pcm 5,121/1,281/4,154; pt-MZ 3,063/767/3,662; sw 1,810/453/748; ts 804/203/254; tw 3,481/388/949; yo 8,522/2,090/4,515. The AfriSenti paper's Table 6 gives each count plus one (it counts the header line), and matches these for every file except Moroccan Arabic dev: the paper gives 1,216 lines, the released ma_dev.tsv holds 494 tweets. - Oromo (orm) and Tigrinya (tir) are not in Subtask A: they have only dev and test data, released for the zero-shot Subtask C, which this package does not include. - @-mentions: every @-mention in the Subtask A files is the @user placeholder (checked over all files; no other @name occurs). - Many Amharic test tweets (am_test_*) are wrapped in a pair of single quotes. They are kept as part of the text, as released, so the text stays exactly as the source wrote it. - The sources give no start date for collection. The AfriSenti paper (Section 4) says: 'The data collection process was conducted before December 20th, 2022.' It also says the Amharic data reused from ETD-AM 'includes tweets that were collected since 2014.' - The reader reads tab-separated files with quoting turned off, so quote characters inside tweets (double or single) are kept as literal text and cannot merge rows. Line breaks inside tweets appear as a literal \n. The input glob *_*.tsv takes only the language files of SubtaskA/train, dev and test, not the README.txt files. The earlier build failed in the delimited reader with quote set to a control character; this draft disables quoting with an empty quote option instead, which the builder should confirm. - The download zip is not shipped, so morrocan_arabic_indiviual_labels.csv (per-annotator Moroccan Arabic labels that keep real Twitter handles and status IDs) is not part of this package; nor are the Subtask B and C files, the data and data_with_annotators_labels folders, the notebooks and the images. All of these are available from the GitHub repository: https://github.com/afrisenti-semeval/afrisent-semeval-2023 - The train file paths in originals other than am_train.tsv follow the folder listing on GitHub; the file profile was cut off after am_train.tsv. - The README counts 14 languages and the SubtaskA README.txt counts 16, adding Setswana and isiZulu, which have no files here. ## Credit - **Shamsuddeen Hassan Muhammad**, creator: dataset contact named in the SubtaskA README.txt - **Idris Abdulmumin**, creator - **Seid Muhie Yimam**, creator - **David Ifeoluwa Adelani**, creator - **Ibrahim Said Ahmad**, creator - **Nedjma Ousidhoum**, creator - **Abinew Ali Ayele**, creator - **Saif M. Mohammad**, creator - **Meriem Beloucif**, creator - **Sebastian Ruder**, creator - **AfriSenti-SemEval (GitHub organisation afrisenti-semeval)**, publisher (https://github.com/afrisenti-semeval/afrisent-semeval-2023) - **Hugging Face (shmuhammad/AfriSenti-twitter-sentiment)**, distributor (https://huggingface.co/datasets/shmuhammad/AfriSenti-twitter-sentiment) - **ECHO, Syracuse University**, packager (https://echo.directory) The upstream documentation is preserved verbatim in `docs/upstream/`. ## Licence and terms CC BY 4.0; SPDX `CC-BY-4.0`, https://creativecommons.org/licenses/by/4.0/. See `LICENSE.md` for the upstream terms. The licence is stated in the repository README. The README asks users to cite the AfriSenti, AfriSenti-SemEval (Task 12), NaijaSenti and ASAB papers. ## Citation ```bibtex @misc{echo2026, title = {ECHO: Exploratory Compendium of Humanity Online}, author = {Switzer, Braden and Zafarani, Reza}, year = {2026}, url = {https://echo.directory}, note = {Syracuse University} } @inproceedings{muhammad-etal-2023-afrisenti, title = {AfriSenti: A Twitter Sentiment Analysis Benchmark for African Languages}, author = {Muhammad, Shamsuddeen Hassan and Abdulmumin, Idris and Ayele, Abinew Ali and Ousidhoum, Nedjma and Adelani, David Ifeoluwa and Yimam, Seid Muhie and Ahmad, Ibrahim Sa'id and Beloucif, Meriem and Mohammad, Saif M. and Ruder, Sebastian and others}, booktitle = {Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing}, year = {2023}, publisher = {Association for Computational Linguistics}, url = {https://arxiv.org/abs/2302.08956} } ``` ## Versions This is version 1.0.0. Every version is kept unchanged at its own address (`https://echo.directory/download/afrisenti-semeval-2023-twitter-sentiment/v1.0.0/`); `CHANGELOG.md` lists what changed between versions.