AndyChiang commited on
Commit
b4f1ea3
1 Parent(s): 42a5dc6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +65 -8
README.md CHANGED
@@ -17,31 +17,88 @@ widget:
17
 
18
  ## Model description
19
 
20
- This model is a **Candidate Set Generator** in **"CDGP: Automatic Cloze Distractor Generation based on Pre-trained Language Model"** at **Findings of EMNLP 2022**.
21
 
22
- Its input are stem and answer, and output is candidate set. It is fine-tuned by [CLOTH](https://github.com/AndyChiangSH/CDGP/blob/main/datasets/CLOTH.zip) dataset based on [bert-base-uncased](https://huggingface.co/bert-base-uncased) model.
23
 
24
- For more details, you can see our paper or [GitHub](https://).
25
 
26
  ## How to use?
27
 
 
 
 
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  ## Dataset
31
 
32
- More information needed
 
 
 
 
 
 
 
 
33
 
34
  ## Training
35
 
 
36
 
37
  ### Training hyperparameters
38
 
39
  The following hyperparameters were used during training:
40
- - optimizer: None
41
- - training_precision: float32
 
 
 
 
 
 
42
 
43
  ## Testing
44
 
45
- ## Model list
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
- ## Citation
 
17
 
18
  ## Model description
19
 
20
+ This model is a Candidate Set Generator in **"CDGP: Automatic Cloze Distractor Generation based on Pre-trained Language Model", Findings of EMNLP 2022**.
21
 
22
+ Its input are stem and answer, and output is candidate set of distractors. It is fine-tuned by [**CLOTH**](https://www.cs.cmu.edu/~glai1/data/cloth/) dataset based on [**bert-base-uncased**](https://huggingface.co/bert-base-uncased) model.
23
 
24
+ For more details, you can see our paper or [GitHub](https://github.com/AndyChiangSH/CDGP).
25
 
26
  ## How to use?
27
 
28
+ 1. Download model by hugging face transformers.
29
+ ```python
30
+ from transformers import BartTokenizer, BartForConditionalGeneration
31
 
32
+ tokenizer = BartTokenizer.from_pretrained("AndyChiang/cdgp-csg-bert-cloth")
33
+ csg_model = BartForConditionalGeneration.from_pretrained("AndyChiang/cdgp-csg-bert-cloth")
34
+ ```
35
+
36
+ 2. Create a unmasker.
37
+ ```python
38
+ unmasker = pipeline('fill-mask', tokenizer=tokenizer, model=csg_model, top_k=10)
39
+ ```
40
+
41
+ 3. Use the unmasker to generate the candidate set of distractors.
42
+ ```python
43
+ sent = "I feel [MASK] now. [SEP] happy"
44
+ cs = unmasker(sent)
45
+ print(cs)
46
+ ```
47
 
48
  ## Dataset
49
 
50
+ This model is fine-tuned by [**CLOTH**](https://www.cs.cmu.edu/~glai1/data/cloth/) dataset, which is a collection of nearly 100,000 cloze questions from middle school and high school English exams. The detail of CLOTH dataset is shown below.
51
+
52
+ | Number of questions | Train | Valid | Test |
53
+ | ------------------- | ----- | ----- | ----- |
54
+ | Middle school | 22056 | 3273 | 3198 |
55
+ | High school | 54794 | 7794 | 8318 |
56
+ | Total | 76850 | 11067 | 11516 |
57
+
58
+ You can also use the [dataset](https://github.com/AndyChiangSH/CDGP/blob/main/datasets/CLOTH.zip) we have already cleaned.
59
 
60
  ## Training
61
 
62
+ We use a special way to fine-tune model, which is called **"Answer-Relating Fine-Tune"**. More detail is in our paper.
63
 
64
  ### Training hyperparameters
65
 
66
  The following hyperparameters were used during training:
67
+
68
+ - Pre-train language model: [bert-base-uncased](https://huggingface.co/bert-base-uncased)
69
+ - Optimizer: adam
70
+ - Learning rate: 0.0001
71
+ - Max length of input: 64
72
+ - Batch size: 64
73
+ - Epoch: 1
74
+ - Device: NVIDIA® Tesla T4 in Google Colab
75
 
76
  ## Testing
77
 
78
+ The evaluations of CDPG with are shown in the table below.
79
+
80
+ The evaluations of this model as a Candidate Set Generator in CDGP is as follows:
81
+
82
+ | P@1 | F1@3 | F1@10 | MRR | NDCG@10 |
83
+ | ----- | ----- | ----- | ----- | ------- |
84
+ | 18.50 | 13.80 | 15.37 | 29.96 | 37.82 |
85
+
86
+ ## Other models
87
+
88
+ ### Candidate Set Generator
89
+
90
+ | Models | CLOTH | DGen |
91
+ | ----------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
92
+ | **BERT** | [*cdgp-csg-bert-cloth*](https://huggingface.co/AndyChiang/cdgp-csg-bert-cloth) | [cdgp-csg-bert-dgen](https://huggingface.co/AndyChiang/cdgp-csg-bert-dgen) |
93
+ | **SciBERT** | [cdgp-csg-scibert-cloth](https://huggingface.co/AndyChiang/cdgp-csg-scibert-cloth) | [cdgp-csg-scibert-dgen](https://huggingface.co/AndyChiang/cdgp-csg-scibert-dgen) |
94
+ | **RoBERTa** | [Acdgp-csg-roberta-cloth](https://huggingface.co/AndyChiang/cdgp-csg-roberta-cloth) | [cdgp-csg-roberta-dgen](https://huggingface.co/AndyChiang/cdgp-csg-roberta-dgen) |
95
+ | **BART** | [cdgp-csg-bart-cloth](https://huggingface.co/AndyChiang/cdgp-csg-bart-cloth) | [cdgp-csg-bart-dgen](https://huggingface.co/AndyChiang/cdgp-csg-bart-dgen) |
96
+
97
+ ### Distractor Selector
98
+
99
+ **fastText**: [cdgp-ds-fasttext](https://huggingface.co/AndyChiang/cdgp-ds-fasttext)
100
+
101
+
102
+ ## Citation
103
 
104
+ None