ashaduzzaman commited on
Commit
73c5d17
·
verified ·
1 Parent(s): fbc0c1d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +73 -39
README.md CHANGED
@@ -6,48 +6,82 @@ tags:
6
  model-index:
7
  - name: bert-finetuned-squad
8
  results: []
 
 
 
 
 
 
 
 
 
 
9
  ---
10
 
11
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
12
  should probably proofread and complete it, then remove this comment. -->
13
 
14
- # bert-finetuned-squad
15
 
16
- This model is a fine-tuned version of [bert-base-cased](https://huggingface.co/bert-base-cased) on an unknown dataset.
17
-
18
- ## Model description
19
-
20
- More information needed
21
-
22
- ## Intended uses & limitations
23
-
24
- More information needed
25
-
26
- ## Training and evaluation data
27
-
28
- More information needed
29
-
30
- ## Training procedure
31
-
32
- ### Training hyperparameters
33
-
34
- The following hyperparameters were used during training:
35
- - learning_rate: 2e-05
36
- - train_batch_size: 8
37
- - eval_batch_size: 8
38
- - seed: 42
39
- - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
40
- - lr_scheduler_type: linear
41
- - num_epochs: 1
42
- - mixed_precision_training: Native AMP
43
-
44
- ### Training results
45
-
46
-
47
-
48
- ### Framework versions
49
-
50
- - Transformers 4.42.4
51
- - Pytorch 2.3.1+cu121
52
- - Datasets 2.21.0
53
- - Tokenizers 0.19.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  model-index:
7
  - name: bert-finetuned-squad
8
  results: []
9
+ datasets:
10
+ - rajpurkar/squad
11
+ language:
12
+ - en
13
+ metrics:
14
+ - accuracy
15
+ - f1
16
+ - exact_match
17
+ library_name: transformers
18
+ pipeline_tag: question-answering
19
  ---
20
 
21
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
22
  should probably proofread and complete it, then remove this comment. -->
23
 
 
24
 
25
+ # BERT Fine-Tuned for Question Answering (SQuAD)
26
+
27
+ ## Model Description
28
+ This model is a fine-tuned version of [BERT-base-cased](https://huggingface.co/bert-base-cased), specifically optimized for the task of question answering. It was trained on the SQuAD (Stanford Question Answering Dataset) to understand and extract relevant information from a given context, based on a provided question. BERT is a transformer-based model that uses attention mechanisms to improve the contextual understanding of text, which makes it well-suited for question-answering tasks.
29
+
30
+ ## Intended Uses & Limitations
31
+ **Intended Uses:**
32
+ - **Question Answering:** This model can be used to extract answers from a given context based on a specific question. It's suitable for applications such as chatbots, virtual assistants, and customer support systems where retrieving relevant information is crucial.
33
+ - **Information Retrieval:** Useful in scenarios requiring quick and accurate information extraction from large bodies of text.
34
+
35
+ **Limitations:**
36
+ - **Domain Adaptation:** The model may not perform well on domains that are significantly different from the training data (e.g., technical manuals, medical documents).
37
+ - **Context Size Limitation:** Due to the input length limit of BERT (512 tokens), the context must be relatively short, or it needs to be chunked appropriately.
38
+ - **Bias and Fairness:** The model may reflect biases present in the SQuAD dataset and its pretraining corpus, potentially affecting the impartiality of answers.
39
+
40
+ ## How to Use
41
+ To use this model for question answering, you can utilize the Hugging Face `transformers` library. Here’s a Python code example:
42
+
43
+ ```python
44
+ from transformers import pipeline
45
+
46
+ model_checkpoint = "Ashaduzzaman/bert-finetuned-squad"
47
+ question_answerer = pipeline("question-answering", model=model_checkpoint)
48
+
49
+ question = "What is the name of the architectures?"
50
+ context = """
51
+ 🤗 Transformers (formerly known as pytorch-transformers and pytorch-pretrained-
52
+ and pytorch-nlp) provides general-purpose architectures (BERT, GPT-2, RoBERTa, XLM, DistilBert, XLNet…) for Natural
53
+ Language Understanding (NLU) and Natural Language Generation (NLG) with over 32+ pretrained models in 100+ languages and
54
+ with state-of-the-art performance on SQuAD, GLUE, AWS Glue, and other benchmarks.
55
+ """
56
+
57
+ result = question_answerer(question=question, context=context)
58
+ print(result['answer'])
59
+ ```
60
+
61
+ ## Training and Evaluation Data
62
+ - **Dataset Used:** The model was fine-tuned on the SQuAD dataset, a benchmark dataset for training and evaluating question-answering models. SQuAD provides a collection of questions and corresponding context paragraphs, with labeled answers.
63
+
64
+ ## Training Procedure
65
+ The model was trained using the Hugging Face `transformers` library with the following hyperparameters:
66
+ - **Learning Rate:** 2e-05
67
+ - **Training Batch Size:** 8
68
+ - **Evaluation Batch Size:** 8
69
+ - **Seed:** 42
70
+ - **Optimizer:** Adam with `betas=(0.9,0.999)` and `epsilon=1e-08`
71
+ - **Learning Rate Scheduler:** Linear
72
+ - **Number of Epochs:** 1
73
+ - **Mixed Precision Training:** Native AMP (Automatic Mixed Precision)
74
+
75
+ ### Training Results
76
+ - **Final Training Loss:** 1.22
77
+ - **Exact Match (EM):** 79.99
78
+ - **F1 Score:** 87.55
79
+
80
+ ## Evaluation
81
+ The model's performance was evaluated using standard SQuAD metrics, including Exact Match (EM) and F1 score. These metrics measure the model's ability to provide accurate and precise answers to the questions based on the context.
82
+
83
+ ## Framework Versions
84
+ - **Transformers:** 4.42.4
85
+ - **PyTorch:** 2.3.1+cu121
86
+ - **Datasets:** 2.21.0
87
+ - **Tokenizers:** 0.19.1