AdamCodd commited on
Commit
4d135c5
1 Parent(s): db5fe62

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +68 -0
README.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - squad_v2
4
+ metrics:
5
+ - f1
6
+ - exact_match
7
+ ---
8
+ ## Distilroberta-squad2
9
+
10
+ This model is [Distilroberta base](https://huggingface.co/distilroberta-base) which was fine-tuned for context-based question answering on the [SQuAD v2](https://huggingface.co/datasets/squad_v2) dataset, a dataset of English-language context-question-answer triples designed for extractive question answering training and benchmarking. Version 2 of SQuAD (Stanford Question Answering Dataset) contains the 100,000 examples from SQuAD Version 1.1, along with 50,000 additional "unanswerable" questions, i.e. questions whose answer cannot be found in the provided context.
11
+
12
+ ## Model description
13
+
14
+ More information needed
15
+
16
+ ## Intended uses & limitations
17
+
18
+ ```python
19
+ from transformers import pipeline
20
+ QA_pipeline = pipeline("question-answering", model="AdamCodd/distilroberta-squad2", handle_impossible_answer=True)
21
+ input = {
22
+ 'question': "Which name is also used to describe the Amazon rainforest in English?",
23
+ 'context': '''The Amazon rainforest (Portuguese: Floresta Amaz么nica or Amaz么nia; Spanish: Selva Amaz贸nica, Amazon铆a or usually Amazonia; French: For锚t amazonienne; Dutch: Amazoneregenwoud), also known in English as Amazonia or the Amazon Jungle, is a moist broadleaf forest that covers most of the Amazon basin of South America. This basin encompasses 7,000,000 square kilometres (2,700,000 sq mi), of which 5,500,000 square kilometres (2,100,000 sq mi) are covered by the rainforest. This region includes territory belonging to nine nations. The majority of the forest is contained within Brazil, with 60% of the rainforest, followed by Peru with 13%, Colombia with 10%, and with minor amounts in Venezuela, Ecuador, Bolivia, Guyana, Suriname and French Guiana. States or departments in four nations contain "Amazonas" in their names. The Amazon represents over half of the planet's remaining rainforests, and comprises the largest and most biodiverse tract of tropical rainforest in the world, with an estimated 390 billion individual trees divided into 16,000 species.'''
24
+ }
25
+ response = QA_pipeline(**input)
26
+ print(response)
27
+ ```
28
+
29
+ ## Training and evaluation data
30
+
31
+ More information needed
32
+
33
+ ## Training procedure
34
+
35
+ ### Training hyperparameters
36
+
37
+ The following hyperparameters were used during training:
38
+ - learning_rate: 3e-05
39
+ - train_batch_size: 16
40
+ - eval_batch_size: 16
41
+ - seed: 42
42
+ - mixed_precision = "fp16"
43
+ - max_seq_len = 386
44
+ - doc_stride = 128
45
+ - optimizer: AdamW with betas=(0.9,0.999) and epsilon=1e-08
46
+ - lr_scheduler_type: linear
47
+ - lr_scheduler_warmup_steps: 0
48
+ - num_epochs: 3
49
+
50
+ ### Training results
51
+ Evaluated on the SQuAD 2.0 dev set with the [official eval script](https://worksheets.codalab.org/rest/bundles/0x6b567e1cf2e041ec80d7098f031c5c9e/contents/blob/).
52
+
53
+ Results:
54
+ ```
55
+ 'exact': 72.60170133917292,
56
+ 'f1': 75.81494036422846,
57
+ 'total': 11873,
58
+ 'HasAns_exact': 72.25033738191632,
59
+ 'HasAns_f1': 78.68603018631661,
60
+ 'HasAns_total': 5928,
61
+ 'NoAns_exact': 72.95206055508831,
62
+ 'NoAns_f1': 72.95206055508831,
63
+ 'NoAns_total': 5945,
64
+ 'best_exact': 72.61012381032594,
65
+ 'best_exact_thresh': 0.0,
66
+ 'best_f1': 75.82336283538154,
67
+ 'best_f1_thresh': 0.0
68
+ ```