Instructions to use Kamyar-zeinalipour/PMCQ-Gemma2-9b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Kamyar-zeinalipour/PMCQ-Gemma2-9b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-2-9b-it") model = PeftModel.from_pretrained(base_model, "Kamyar-zeinalipour/PMCQ-Gemma2-9b") - Notebooks
- Google Colab
- Kaggle
Given a Persian text, this model writes a multiple-choice question about it with one correct answer and three plausible distractors (labelled Ψ§ΩΩ/Ψ¨/Ψ¬/Ψ―). It is a LoRA adapter for Gemma-2-9B-it trained on PersianMCQ-Instruct.
From the paper PersianMCQ-Instruct: A Comprehensive Resource for Generating Multiple-Choice Questions in Persian (LoResLM 2025). Code: GitHub.
Results
Expert rating of 200 generated questions (A = 5 β¦ E = 1): 2.72 β 2.78 (base β this model). BERTScore F1 against reference questions: 0.888 β 0.903.
Usage
The generator script in the GitHub repository handles prompting and output parsing:
git clone https://github.com/KamyarZeinalipour/Persian_MCQ && cd Persian_MCQ && pip install -r requirements.txt
python main.py --model-name PMCQ-Gemma2-9b --input-file input.csv --output-file output.csv
where input.csv has a text column of Persian passages. The adapter repository includes the
tokenizer, so it also loads directly with peft.AutoPeftModelForCausalLM.from_pretrained("Kamyar-zeinalipour/PMCQ-Gemma2-9b").
Training
LoRA r = 16, Ξ± = 32, dropout 0.1 on all attention and MLP projections, embed_tokens and lm_head;
3 epochs; AdamW, learning rate 1e-4, cosine decay; 4 sequences per GPU Γ 4 accumulation steps;
up to 3,500 tokens; bf16, DeepSpeed, seed 100. Training data: Persian_MCQ_DB__Gemma.
PersianMCQ-Instruct models
| Model | Human rating, base β fine-tuned | BERTScore F1, base β fine-tuned |
|---|---|---|
| Gemma-2-9B-it (PMCQ-Gemma2-9b (this model)) | 2.72 β 2.78 | 0.888 β 0.903 |
| Llama-3.1-8B-Instruct (PMCQ-Llama3.1-8b) | 3.31 β 4.51 | 0.881 β 0.905 |
| Mistral-7B-Instruct-v0.3 (PMCQ-Mistral-7B) | 1.30 β 4.32 | 0.874 β 0.904 |
Citation
@inproceedings{zeinalipour-etal-2025-persianmcq,
title = "{P}ersian{MCQ}-Instruct: A Comprehensive Resource for Generating Multiple-Choice Questions in {P}ersian",
author = "Zeinalipour, Kamyar and
Jamshidi, Neda and
Akbari, Fahimeh and
Maggini, Marco and
Bianchini, Monica and
Gori, Marco",
editor = "Hettiarachchi, Hansi and
Ranasinghe, Tharindu and
Rayson, Paul and
Mitkov, Ruslan and
Gaber, Mohamed and
Premasiri, Damith and
Tan, Fiona Anting and
Uyangodage, Lasitha",
booktitle = "Proceedings of the First Workshop on Language Models for Low-Resource Languages",
month = jan,
year = "2025",
address = "Abu Dhabi, United Arab Emirates",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2025.loreslm-1.27/",
pages = "344--372"
}
License
Released under the base model's license (gemma).
- Downloads last month
- 43