--- datasets: - SajjadAyoubi/persian_qa language: - fa pipeline_tag: question-answering license: apache-2.0 library_name: transformers tags: - roberta - question-answering - Persian --- # Tara-Roberta-Base-FA-QA **Tara-Roberta-Base-FA-QA** is a fine-tuned version of the `facebookAI/roberta-base` model for question-answering tasks, trained on the [SajjadAyoubi/persian_qa](https://huggingface.co/datasets/SajjadAyoubi/persian_qa) dataset. This model is designed to understand and generate answers to questions posed in Persian. ## Model Description This model was fine-tuned on a dataset containing Persian question-answering pairs. It leverages the `roberta-base` architecture to provide answers based on the context provided. The training process was performed with a focus on improving the model's ability to handle Persian text and answer questions effectively. ## Training Details The model was trained for 3 epochs with the following training and validation losses: - **Epoch 1**: - Training Loss: 2.0713 - Validation Loss: 2.1061 - **Epoch 2**: - Training Loss: 2.1558 - Validation Loss: 2.0121 - **Epoch 3**: - Training Loss: 2.0951 - Validation Loss: 2.0168 ## Evaluation Results The model achieved the following results: - **Training Loss**: Decreased over the epochs, indicating effective learning. - **Validation Loss**: Slight variations were observed, reflecting the model's performance on unseen data. ## Usage To use this model for question-answering tasks, load it with the `transformers` library: ```python from transformers import AutoTokenizer, AutoModelForQuestionAnswering, pipeline model = "hosseinhimself/tara-roberta-base-fa-qa" # Load the tokenizer and model tokenizer = AutoTokenizer.from_pretrained(model) model = AutoModelForQuestionAnswering.from_pretrained(model) # Create a QA pipeline qa_pipeline = pipeline("question-answering", model=model, tokenizer=tokenizer) # Example usage context = "CONTEXT" question = "QUESTION" # Modify the pipeline to return more answers results = qa_pipeline(question=question, context=context, top_k=5) # top_k specifies the number of answers # Display the answers for idx, result in enumerate(results): print(f"Answer {idx+1}: {result['answer']}") ``` ## Datasets The model was fine-tuned using the [SajjadAyoubi/persian_qa](https://huggingface.co/datasets/SajjadAyoubi/persian_qa) dataset. ## Languages The model supports the Persian language. ## Additional Information For more details on how to fine-tune similar models or to report issues, please visit the [Hugging Face documentation](https://huggingface.co/docs/transformers).