SaveBertAndGpt commited on
Commit
6a99675
1 Parent(s): 06af79e

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +103 -0
README.md ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: "en" # Example: en
3
+ license: "cc-by-4.0" # Example: apache-2.0 or any license from https://hf.co/docs/hub/repositories-licenses
4
+ library_name: "transformers" # Optional. Example: keras or any library from https://github.com/huggingface/hub-docs/blob/main/js/src/lib/interfaces/Libraries.ts
5
+ ---
6
+ # Model description
7
+ This is the T5-3B model for the "classify" component of System 4's "Classify then explain" pipeline, as described in our paper Just-DREAM-about-it: Figurative Language Understanding with DREAM-FLUTE, FigLang workshop @ EMNLP 2022 (Arxiv link: TBD)
8
+
9
+ System 4: Two-step System - Classify then explain
10
+
11
+ In contrast to Systems 1 to 3 where the entailment/contradiction label and associated explanation are predicted jointly, System 4 uses a two-step “classify then explain” pipeline. This current model is for the "classify" component of the pipeline. The input-output format is:
12
+ ```
13
+ Input <Premise> <Hypothesis>
14
+ Output <Label>
15
+ ```
16
+
17
+ # How to use this model?
18
+ We provide a quick example of how you can try out the "classify" component of System 4 in our paper with just a few lines of code:
19
+ ```
20
+ >>> from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
21
+ >>> model = AutoModelForSeq2SeqLM.from_pretrained("allenai/System4_classify_FigLang2022")
22
+
23
+ >>> tokenizer = AutoTokenizer.from_pretrained("t5-3b")
24
+ >>> input_string = "Premise: After releasing his rage he was like a ferocious wolf. Hypothesis: After letting off his rage he sat down like a lamb. Is there a contradiction or entailment between the premise and hypothesis? Answer : "
25
+ >>> input_ids = tokenizer.encode(input_string, return_tensors="pt")
26
+ >>> output = model.generate(input_ids, max_length=200)
27
+ >>> tokenizer.batch_decode(output, skip_special_tokens=True)
28
+ ['Contradiction']
29
+ ```
30
+
31
+ # More details about DREAM-FLUTE ...
32
+ For more details about DREAM-FLUTE, please refer to our:
33
+ * 📄Paper: (Arxiv link: TBD)
34
+ * 💻GitHub Repo: https://github.com/allenai/dream/
35
+
36
+ This model is part of our DREAM-series of works. This is a line of research where we make use of scene elaboration for building a "mental model" of situation given in text. Check out our GitHub Repo for more!
37
+
38
+ # More details about this model ...
39
+ ## Training and evaluation data
40
+
41
+ We use the FLUTE dataset for the FigLang2022SharedTask (https://huggingface.co/datasets/ColumbiaNLP/FLUTE) for training this model. ∼7500 samples are provided as the training set. We used a 80-20 split to create our own training (6027 samples) and validation (1507 samples) partitions on which we build our models. For details on how we make use of the training data provided in the FigLang2022 shared task, please refer to https://github.com/allenai/dream/blob/main/FigLang2022SharedTask/Process_Data_Train_Dev_split.ipynb.
42
+
43
+ ## Model details
44
+ This model is a fine-tuned version of [t5-3b](https://huggingface.co/t5-3b).
45
+
46
+ It achieves the following results on the evaluation set:
47
+ - Loss: 0.0604
48
+ - Rouge1: 95.0232
49
+ - Rouge2: 0.0
50
+ - Rougel: 95.0232
51
+ - Rougelsum: 95.0232
52
+ - Gen Len: 3.4074
53
+
54
+ ## Model description
55
+
56
+ More information needed
57
+
58
+ ## Intended uses & limitations
59
+
60
+ More information needed
61
+
62
+ ## Training and evaluation data
63
+
64
+ More information needed
65
+
66
+ ## Training procedure
67
+
68
+ ### Training hyperparameters
69
+
70
+ The following hyperparameters were used during training:
71
+ - learning_rate: 5e-05
72
+ - train_batch_size: 1
73
+ - eval_batch_size: 1
74
+ - seed: 42
75
+ - distributed_type: multi-GPU
76
+ - num_devices: 2
77
+ - total_train_batch_size: 2
78
+ - total_eval_batch_size: 2
79
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
80
+ - lr_scheduler_type: linear
81
+ - num_epochs: 3.0
82
+
83
+ ### Training results
84
+
85
+ | Training Loss | Epoch | Step | Validation Loss | Rouge1 | Rouge2 | Rougel | Rougelsum | Gen Len |
86
+ |:-------------:|:-----:|:----:|:---------------:|:-------:|:------:|:-------:|:---------:|:-------:|
87
+ | 0.1221 | 0.33 | 1000 | 0.1460 | 91.7717 | 0.0 | 91.9044 | 91.8381 | 3.4751 |
88
+ | 0.0957 | 0.66 | 2000 | 0.0904 | 93.6297 | 0.0 | 93.6961 | 93.6961 | 3.3955 |
89
+ | 0.0721 | 1.0 | 3000 | 0.0720 | 94.8905 | 0.0 | 94.9569 | 94.8905 | 3.4061 |
90
+ | 0.0413 | 1.33 | 4000 | 0.0786 | 94.5587 | 0.0 | 94.5587 | 94.5587 | 3.4346 |
91
+ | 0.042 | 1.66 | 5000 | 0.0604 | 95.0232 | 0.0 | 95.0232 | 95.0232 | 3.4074 |
92
+ | 0.0413 | 1.99 | 6000 | 0.0737 | 95.2223 | 0.0 | 95.2223 | 95.2223 | 3.4413 |
93
+ | 0.0198 | 2.32 | 7000 | 0.1045 | 95.0896 | 0.0 | 95.1559 | 95.1559 | 3.4101 |
94
+ | 0.0253 | 2.65 | 8000 | 0.0836 | 95.2887 | 0.0 | 95.2887 | 95.2887 | 3.4393 |
95
+ | 0.0198 | 2.99 | 9000 | 0.0922 | 94.7578 | 0.0 | 94.7578 | 94.7578 | 3.4180 |
96
+
97
+
98
+ ### Framework versions
99
+
100
+ - Transformers 4.22.0.dev0
101
+ - Pytorch 1.12.1+cu113
102
+ - Datasets 2.4.0
103
+ - Tokenizers 0.12.1