Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,42 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- fa
|
5 |
+
base_model:
|
6 |
+
- google/mt5-base
|
7 |
+
pipeline_tag: summarization
|
8 |
+
library_name: transformers
|
9 |
+
---
|
10 |
+
|
11 |
+
# mT5-Based Persian Question Generator
|
12 |
+
|
13 |
+
This repository demonstrates how to fine-tune the mT5 (Multilingual T5) model for generating questions from Persian text. It includes preprocessing data, fine-tuning the model, and generating questions using Hugging Face's Transformers library.
|
14 |
+
|
15 |
+
---
|
16 |
+
|
17 |
+
## Features
|
18 |
+
- Preprocess Persian text data to ensure high-quality training samples.
|
19 |
+
- Fine-tune the mT5 model on question-generation tasks.
|
20 |
+
- Evaluate and generate questions from Persian texts using the fine-tuned model.
|
21 |
+
|
22 |
+
---
|
23 |
+
|
24 |
+
## Generating Questions
|
25 |
+
Use the fine-tuned model to generate questions from Persian text:
|
26 |
+
```python
|
27 |
+
from transformers import pipeline
|
28 |
+
|
29 |
+
pipe = pipeline("summarization", model="myrkur/persian-question-generator", device_map="auto")
|
30 |
+
sample_text = """شبکههای اجتماعی،هوموفیلی و اگزیستانسیالیم..."""
|
31 |
+
generated_question = pipe([sample_text], temperature=0.3, do_sample=True, repetition_penalty=1.1)
|
32 |
+
print(generated_question)
|
33 |
+
```
|
34 |
+
|
35 |
+
---
|
36 |
+
|
37 |
+
|
38 |
+
## Results and Usage
|
39 |
+
The fine-tuned model generates natural and contextually relevant questions from Persian text. This can be utilized for:
|
40 |
+
- Educational tools
|
41 |
+
- Conversational AI
|
42 |
+
- Persian text comprehension applications
|