Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: fa
|
| 3 |
+
tags:
|
| 4 |
+
- parsbert
|
| 5 |
+
- bert
|
| 6 |
+
- question-answering
|
| 7 |
+
- nlp
|
| 8 |
+
license: mit
|
| 9 |
+
base_model: hooshvare/parsbert-base-uncased
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# PQuAD: Persian Question Answering Model
|
| 13 |
+
|
| 14 |
+
This model is a fine-tuned version of **[ParsBERT](https://huggingface.co/hooshvare/parsbert-base-uncased)** (state-of-the-art Persian language model) for the task of **Question Answering**.
|
| 15 |
+
|
| 16 |
+
It was trained on a proprietary Persian QA dataset as part of a BSc thesis at **Amirkabir University of Technology**.
|
| 17 |
+
|
| 18 |
+
## Model Details
|
| 19 |
+
- **Base Model:** ParsBERT (Hooshvare Lab)
|
| 20 |
+
- **Task:** Extractive Question Answering
|
| 21 |
+
- **Language:** Persian (Farsi)
|
| 22 |
+
- **Framework:** PyTorch & Transformers
|
| 23 |
+
|
| 24 |
+
## How to Use
|
| 25 |
+
You can use this model directly with the Hugging Face `pipeline`:
|
| 26 |
+
|
| 27 |
+
```python
|
| 28 |
+
from transformers import pipeline
|
| 29 |
+
|
| 30 |
+
# Load the pipeline
|
| 31 |
+
qa_pipeline = pipeline("question-answering", model="newsha/PQuAD")
|
| 32 |
+
|
| 33 |
+
context = "دانشگاه صنعتی امیرکبیر یکی از باسابقهترین دانشگاههای فنی ایران است که در سال ۱۳۳۷ در تهران تأسیس شد."
|
| 34 |
+
question = "دانشگاه امیرکبیر در چه سالی تأسیس شد؟"
|
| 35 |
+
|
| 36 |
+
result = qa_pipeline(question=question, context=context)
|
| 37 |
+
print(f"Answer: {result['answer']}")
|
| 38 |
+
# Output: ۱۳۳۷
|