File size: 3,672 Bytes
3d45e31
 
 
 
54d8709
3d45e31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55a2adf
3d45e31
 
 
 
 
 
 
db17066
3d45e31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
language: "en"  # Example: en
license: "cc-by-4.0"  # Example: apache-2.0 or any license from https://hf.co/docs/hub/repositories-licenses
library_name: "transformers"  # Optional. Example: keras or any library from https://github.com/huggingface/hub-docs/blob/main/js/src/lib/interfaces/Libraries.ts

---

This is the T5-11B model described in our paper DREAM: Improving Situational QA by First Elaborating the Situation, NAACL 2022 (Arxiv link: https://arxiv.org/abs/2112.08656, ACL Anthology link: https://aclanthology.org/2022.naacl-main.82/)
  
  
  
# What is DREAM ๐Ÿ’ญ?
DREAM can be used to:

* Build scene elaborations in a dataset-neutral way ๐Ÿ–ผ๏ธ

* ๐Ÿ“ˆ Improve QA performance across different end-tasks and on different models ๐Ÿ“ˆ

When people ๐Ÿง‘โ€๐Ÿ’ป answer questions about a specific situation, cognitive science ๐Ÿง  suggests that they form a mental picture ๐Ÿ–ผ๏ธ of that situation. Will language models ๐Ÿค– answer such questions more accurately if provided with additional details about the question situation ๐Ÿ–ผ๏ธ ?

We train a new model, DREAM ๐Ÿ’ญ , to answer questions that elaborate the scenes ๐Ÿ–ผ๏ธ that situated questions are about, and then provide those elaborations as additional context ๐Ÿ“„ to a QA model ๐Ÿค– . Our results show that DREAM ๐Ÿ’ญ is able to create more โœ… accurate, โœ… useful, and โœ… consistent scene elaborations than a representative
SOTA ๐ŸŒŸ, zero-shot model (Macaw ๐Ÿฆœ ).

Remarkably, using DREAMโ€™s ๐Ÿ’ญ scene elaborations ๐Ÿ–ผ๏ธ as additional context improves๐Ÿ“ˆ the answer accuracy across different downstream QA systems ๐Ÿค– and on different end-tasks ๐Ÿ“ (including beyond that obtainable by further fine-tuning the QA system on DREAMโ€™s training data ๐Ÿ“š). Our approach is question-agnostic ๐Ÿ’ซ, leaves end-task QA models unchanged โœจ, and thus easily portable to other QA models ๐ŸŒŸ, suggesting exciting opportunities for further improving and exploiting scene elaborations to better solve new problems. ๐Ÿ’ก

We invite you to try out DREAM ๐Ÿ’ญ for your own application!
    
    
    
# How to use DREAM ๐Ÿ’ญ?
We provide a quick example of how you can try out DREAM with just a few lines of code:
```
>>> from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
>>> model = AutoModelForSeq2SeqLM.from_pretrained("allenai/DREAM")

>>> tokenizer = AutoTokenizer.from_pretrained("t5-11b")
>>> input_string = "$answer$ ; $question$ = [SITUATION] hitting someones car in the drive thru on purpose. [QUERY] rot"
>>> input_ids = tokenizer.encode(input_string, return_tensors="pt")
>>> output = model.generate(input_ids, max_length=200)
>>> tokenizer.batch_decode(output, skip_special_tokens=True)
["$answer$ = It's wrong to damage other people's property."]
```

As discussed in our paper, DREAM supports the following possible dimensions for each input situation S:
```
1. M : motivation of character(s) before S.
2. E: emotion of character(s) after S.
3. ROT : general Rule of Thumb (ROT) about whether action described in S is socially acceptable or not (also known as social norm).
4. Con: likely consequence of action in S.
```
To get DREAM's output for these dimensions, use the corresponding terms below after the "[QUERY] " tag in your input string:
```
motivation
emotion
rot
consequence
```
    
    
    
# More details about DREAM ๐Ÿ’ญ ...
For more details about DREAM, please refer to our:
* ๐Ÿ“„Paper: https://aclanthology.org/2022.naacl-main.82/
* ๐Ÿ’ปDataset & Model: https://github.com/allenai/dream/

For additional instructions about using the DREAM model and sample commands, please refer to https://github.com/allenai/dream/blob/main/model/README_DREAM_model.md.