Generate synthetic labeled data for extremely low-resource languages using bilingual lexicons.
# LexC-Gen: Generating Data for Extremely Low-Resource Languages with Large Language Models and Bilingual Lexicons
LexC-Gen (which stands for **lexicon-conditioned generation**) generates labeled classification data for extremely low-resource languages using open-access LLMs and bilingual lexicons. The key idea is to prompt LLMs to generate English (or any high-resource-language) task data using words from bilingual lexicons so the generated dataset can be better word-translated into low-resource languages. Here, we explore sentiment analysis and topic classification for 17 extremely low-resource languages.
💻 This repository provides code for LexC-Gen used for generating sentiment analysis and topic classification data using Gatitos bilingual lexicons and reproducing our paper. But our code are written in a modular manner so it can be easily adapted to other tasks or bilingual lexicons.
🧩 We provide our main results for NusaX and SIB-200 in `paper_results/` with average accuracy and standard deviations (over 5 runs) reported, which can serve as a form of sanity check for other researchers reproducing our work.
⭐️ **Our work is accepted to the Findings of EMNLP 2024!**
---
## Table of Contents
- Setup
- Download Task Datasets and Bilingual Lexicons
- Task Datasets
- Bilingual Lexicons
- LexC-Gen Code
- 1. CTG-Training
- 2. Lexicon-Conditioned Task Data Generation
- 3. Input-Label Filtering and Word-to-Word Translation
- Evaluation
- 1. Generate Validation Dataset for Task Finetuning
- 2. Evaluate on Local LexC-Gen Data
- Evaluate on HF LexC-Gen Data
- Baselines
- Cross-Lingual Zero-Shot
- Word Translation
- Notes
- Bibtex
---
## Setup
```bash
git clone
github.com
cd LexC-Gen
pip3 install -r requirements.txt
mkdir outputs # create outputs directory in LexC-Gen folder for storing all generated data artifacts
```
## Download Task Datasets and Bilingual Lexicons
### Task Datasets
We experiment with NusaX (Winata et al. …