This repository focuses on Named Entity Recognition (NER) fine-tuning for low-resource languages, specifically Mizo and Khasi. It includes scripts for model training and a data preprocessing pipeline that converts raw XML datasets into CSV format. ππ
# π NER Fine-tuning, Prediction & XML to CSV Conversion
## π Overview
This repository contains scripts for:
- **Fine-tuning Named Entity Recognition (NER) models** π·οΈ
- **Performing NER predictions on text files** π
- **Converting XML raw data to CSV format** (specifically for Mizo & Khasi languages) π
- **Dataset preparation and training logs** π
## π Project Structure
```
π¦ YourRepoName
βββ π NER_Finetune_Pipeline.py # NER fine-tuning script
βββ π NER_output.py # NER prediction script
βββ π Data_conversion_and_preprocess.ipynb # XML to CSV & conll conversion notebook for Mizo & Khasi data
βββ π logs/ # Training logs and reports
βββ π requirements.txt # Dependencies
βββ π README.md # Project Documentation
```
## π·οΈ Fine-tuning NER Models
### π§ **How to Run**
1οΈβ£ Install dependencies:
```bash
pip install -r requirements.txt
```
2οΈβ£ Run the fine-tuning script:
```bash
python finetune_ner.py
```
### π **Key Features**
- β
Supports multiple transformer-based models
- β
Implements class weighting for imbalanced datasets
- β
Generates classification reports automatically π
- β
Efficient GPU memory management π₯οΈ
## π NER Prediction
The `predict_ner.py` script loads a fine-tuned NER model and predicts entity labels for sentences in a given text file.
### π§ **How to Run**
1οΈβ£ Ensure that the fine-tuned model is available.
2οΈβ£ Run the prediction script:
```bash
python predict_ner.py
```
3οΈβ£ The output will be saved in a structured CoNLL format.
### π **Key Features**
- β
Uses a fine-tuned transformer model for inference
- β
Splits long sentences automatically to fit model constraints
- β
Outputs results in a CoNLL-style format for easy analysis
## π XML to CSV Conversion
This Jupyter Notebook extracts data from **raw XML files** and converts them into **CSV format** for Mizo and Khasi languages.
### π§ **How to Run**
1οΈβ£ Open the Jupyter Notebook:
```ba β¦