# COS 802 – Cross-Lingual Embeddings for South African Languages (IsiZulu, Sepedi, and Setswana)
This repository contains the code for the COS 802 final project that investigates
cross-lingual word embeddings for South African languages, focusing on
IsiZulu (ZU), Setswana (TN), and Sepedi (NSO). English (EN) and Afrikaans (AF) are used as pivot languages.
The project compares:
- **Pivot-based vs direct alignment**, and
- **Unsupervised VecMap vs supervised Canonical Correlation Analysis (CCA)**
Monolingual FastText embeddings are trained on Autshumato corpora
(EN, AF, TN, NSO) and a Hugging Face Nguni corpus for IsiZulu.
Alignment quality is evaluated intrinsically using bilingual lexicon
induction and extrinsically using Named Entity Recognition (NER)
with MasakhaNER 2.0 (loaded via Hugging Face).
All steps are implemented in a single end-to-end notebook to be ran using Google Colab:
- `COS802_Crosslingual_Embeddings_Autshumato_HF_Pivots_u25738497.ipynb`
When the data and folders are set up as described below, the notebook
can be run from start to finish without modifying any code.
---
## 1. Repository contents
```text
.
├── README.md - (This document) - document containg project description and instructions on how to run the code
├── requirements.txt - short document containing the python package requirements - **Only for local execution through Anaconda (Jupyter notebook)**
└── COS802_Crosslingual_Embeddings_Autshumato_HF_Pivots_u25738497.ipynb - Google Colab notebook with project code
```
All other files (corpora, lexicons, trained models, aligned embeddings)
are stored in **Google Drive**, not in the repo.
---
## 2. Google Drive folder structure
Create a high-level folder in your Google Drive called:
```text
crosslingual_project/
```
Inside it, create the following subfolders:
```text
crosslingual_project/
├── corpora/ #starts empyty; holds the four Autshumato ZIP files
│
├── lexicons/ #starts empty; downloaded automatically by the not …