system HF staff commited on
Commit
73ae024
1 Parent(s): ca553a3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +63 -0
README.md ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Model
2
+ **[`monologg/biobert_v1.1_pubmed`](https://huggingface.co/monologg/biobert_v1.1_pubmed)** fine-tuned on **[`SQuAD V2`](https://rajpurkar.github.io/SQuAD-explorer/)** using **[`run_squad.py`](https://github.com/huggingface/transformers/blob/master/examples/run_squad.py)**
3
+
4
+ This model is cased.
5
+
6
+ ### Training Parameters
7
+ Trained on 4 NVIDIA GeForce RTX 2080 Ti 11Gb
8
+ ```bash
9
+ BASE_MODEL=monologg/biobert_v1.1_pubmed
10
+ python run_squad.py \
11
+ --version_2_with_negative \
12
+ --model_type albert \
13
+ --model_name_or_path $BASE_MODEL \
14
+ --output_dir $OUTPUT_MODEL \
15
+ --do_eval \
16
+ --do_lower_case \
17
+ --train_file $SQUAD_DIR/train-v2.0.json \
18
+ --predict_file $SQUAD_DIR/dev-v2.0.json \
19
+ --per_gpu_train_batch_size 18 \
20
+ --per_gpu_eval_batch_size 64 \
21
+ --learning_rate 3e-5 \
22
+ --num_train_epochs 3.0 \
23
+ --max_seq_length 384 \
24
+ --doc_stride 128 \
25
+ --save_steps 2000 \
26
+ --threads 24 \
27
+ --warmup_steps 550 \
28
+ --gradient_accumulation_steps 1 \
29
+ --fp16 \
30
+ --logging_steps 50 \
31
+ --do_train
32
+ ```
33
+
34
+ ### Evaluation
35
+
36
+ Evaluation on the dev set. I did not sweep for best threshold.
37
+
38
+ | | val |
39
+ |-------------------|-------------------|
40
+ | exact | 75.97068980038743 |
41
+ | f1 | 79.37043950121722 |
42
+ | total | 11873.0 |
43
+ | HasAns_exact | 74.13967611336032 |
44
+ | HasAns_f1 | 80.94892513460755 |
45
+ | HasAns_total | 5928.0 |
46
+ | NoAns_exact | 77.79646761984861 |
47
+ | NoAns_f1 | 77.79646761984861 |
48
+ | NoAns_total | 5945.0 |
49
+ | best_exact | 75.97068980038743 |
50
+ | best_exact_thresh | 0.0 |
51
+ | best_f1 | 79.37043950121729 |
52
+ | best_f1_thresh | 0.0 |
53
+
54
+
55
+ ### Usage
56
+
57
+ See [huggingface documentation](https://huggingface.co/transformers/model_doc/bert.html#bertforquestionanswering). Training on `SQuAD V2` allows the model to score if a paragraph contains an answer:
58
+ ```python
59
+ start_scores, end_scores = model(input_ids)
60
+ span_scores = start_scores.softmax(dim=1).log()[:,:,None] + end_scores.softmax(dim=1).log()[:,None,:]
61
+ ignore_score = span_scores[:,0,0] #no answer scores
62
+
63
+ ```