up readme
Browse files
README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- question-answering
|
| 5 |
+
- squad
|
| 6 |
+
- transformers
|
| 7 |
+
- pytorch
|
| 8 |
+
- evaluation
|
| 9 |
+
- hf-course
|
| 10 |
+
- fine-tuned
|
| 11 |
+
datasets:
|
| 12 |
+
- squad
|
| 13 |
+
metrics:
|
| 14 |
+
- exact_match
|
| 15 |
+
- f1
|
| 16 |
+
model-index:
|
| 17 |
+
- name: QA-SQuAD-BERT
|
| 18 |
+
results:
|
| 19 |
+
- task:
|
| 20 |
+
type: question-answering
|
| 21 |
+
name: Question Answering
|
| 22 |
+
dataset:
|
| 23 |
+
name: SQuAD v1.1
|
| 24 |
+
type: squad
|
| 25 |
+
metrics:
|
| 26 |
+
- name: Exact Match
|
| 27 |
+
type: exact_match
|
| 28 |
+
value: 82.7
|
| 29 |
+
- name: F1
|
| 30 |
+
type: f1
|
| 31 |
+
value: 87.0039
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
# QA-SQuAD-BERT
|
| 35 |
+
|
| 36 |
+
A BERT-based model fine-tuned on SQuAD v1.1 for extractive QA
|
| 37 |
+
|
| 38 |
+
## Model Description
|
| 39 |
+
|
| 40 |
+
This model is based on bert-base-uncased and was fine-tuned on the **SQuAD v1.1** dataset for extractive question answering. It takes a question and a context passage as input and predicts the span of text in the passage that most likely answers the question.
|
| 41 |
+
|
| 42 |
+
The model was trained using the Hugging Face 馃 Transformers library.
|
| 43 |
+
|
| 44 |
+
## Intended Uses & Limitations
|
| 45 |
+
|
| 46 |
+
### Intended Uses
|
| 47 |
+
|
| 48 |
+
- Extractive question answering on Wikipedia-style passages.
|
| 49 |
+
- As a downstream component in information retrieval pipelines.
|
| 50 |
+
- Educational purposes or experimentation with fine-tuning on QA tasks.
|
| 51 |
+
|
| 52 |
+
### Limitations
|
| 53 |
+
|
| 54 |
+
- The model may not generalize well to out-of-domain datasets.
|
| 55 |
+
- It does not handle unanswerable questions (not trained on SQuAD v2.0).
|
| 56 |
+
- It may produce incorrect or misleading answers if context is ambiguous.
|
| 57 |
+
|
| 58 |
+
## Training Details
|
| 59 |
+
|
| 60 |
+
- **Base model**: bert-base-uncased
|
| 61 |
+
- **Dataset**: [SQuAD v1.1](https://huggingface.co/datasets/squad)
|
| 62 |
+
- **Epochs**: 3
|
| 63 |
+
- **Batch size**: 8
|
| 64 |
+
- **Learning rate**: 2e-5
|
| 65 |
+
- **Optimizer**: AdamW
|
| 66 |
+
- **Max length**: 384
|
| 67 |
+
- **Hardware used**: Colab/GPU T4
|
| 68 |
+
|
| 69 |
+
## Evaluation Results
|
| 70 |
+
|
| 71 |
+
The model was evaluated on the SQuAD v1.1 development set using the standard metrics: Exact Match (EM) and F1.
|
| 72 |
+
|
| 73 |
+
| Metric | Score |
|
| 74 |
+
|--------------|-------|
|
| 75 |
+
| Exact Match | 82.7 |
|
| 76 |
+
| F1 | 87.0039 |
|
| 77 |
+
|
| 78 |
+
## How to Use
|
| 79 |
+
|
| 80 |
+
You can load this model using the `pipeline` API:
|
| 81 |
+
|
| 82 |
+
```python
|
| 83 |
+
from transformers import pipeline
|
| 84 |
+
|
| 85 |
+
qa_pipeline = pipeline("question-answering", model="<!-- TODO: model repo name -->")
|
| 86 |
+
result = qa_pipeline({
|
| 87 |
+
"context": "Hugging Face is creating a tool that democratizes AI.",
|
| 88 |
+
"question": "What is Hugging Face creating?"
|
| 89 |
+
})
|
| 90 |
+
print(result)
|