this is a fine-tuned version of the ParsBERT model, specifically adapted for the task of question answering in Persian. ParsBERT is a BERT-based model pre-trained on a large Persian text corpus. This model has been fine-tuned on a Persian QA dataset to provide accurate and contextually relevant answers to questions posed in Persian.
This model is intended for use in applications requiring natural language understanding and question answering in Persian, such as:
The model was fine-tuned on a Persian QA dataset. The dataset consists of question-answer pairs extracted from various Persian text sources, ensuring a diverse range of topics and contexts.
To use this model for question answering in Persian, you can load it using the Hugging Face Transformers library. Here’s a quick example:
1from transformers import AutoTokenizer, AutoModelForQuestionAnswering, pipeline
2
3# Load the tokenizer and model
4tokenizer = AutoTokenizer.from_pretrained("mansoorhamidzadeh/parsbert-persian-QA")
5model = AutoModelForQuestionAnswering.from_pretrained("mansoorhamidzadeh/parsbert-persian-QA")
6
7# Create a QA pipeline
8qa_pipeline = pipeline("question-answering", model=model, tokenizer=tokenizer)
9
10# Example usage
11context = "متن زمینه که شامل اطلاعات مرتبط با سوال شما است."
12question = "سوال شما چیست؟"
13result = qa_pipeline(question=question, context=context)
14
15print(f"Answer: {result['answer']}")