language: en
license: cc-by-4.0
library_name: transformers
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("SaveBertAndGpt/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.