Logo Lanfrica

Soumyadip0806/NER-Finetuning

Domain:

natural language processing

Record type:

software
Creator:
Sou
Host:
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 …