Downloads · 30 days
32
1% of all-time downloads
liujch1998/rainier-large
rainier-large is a text generation model from liujch1998. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
Rainier is a knowledge introspection model for commonsense QA. See our paper at: <https://arxiv.org/abs/2210.03078.
Downloads · 30 days
32
1% of all-time downloads
All-time downloads
3.1K
Public
Repo size
8.9 GB
Likes
2
Public
Click a slice to open those files.
.bin3 GB · 100%
From the Hugging Face model README
Rainier is a knowledge introspection model for commonsense QA. See our paper at: https://arxiv.org/abs/2210.03078.
Given a commonsense question as input, Rainier generates a knowledge statement that is related to the question and (hopefully) helpful for answering it. By sampling from the output, Rainier can generate a diverse set of related knowledge. The introspected knowledge can be further prompted to a QA model and improves its prediction accuracy.
Rainier is intended to generate commonsense knowledge statements related to answering a given commonsense question.
Rainier is a research prototype and may generate incorrect or irrelevant knowledge. Do not use for making critical decisions. It is intended to generate knowledge statements for questions about commonsense, and may be unreliable when taking input out of this scope.
See the Limitations section of our paper.
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
Use the code below to get started with the model.
from transformers import T5Tokenizer, T5ForConditionalGeneration
tokenizer = T5Tokenizer.from_pretrained('t5-large')
model = T5ForConditionalGeneration.from_pretrained('liujch1998/rainier-large')
question = "Sydney rubbed Addison’s head because she had a horrible headache. " \
"What will happen to Sydney? \\n " \
"(A) drift to sleep (B) receive thanks (C) be reprimanded"
input_ids = tokenizer(question, return_tensors='pt').input_ids
output_ids = model.generate(input_ids, do_sample=True, top_p=0.5, num_return_sequences=10)
knowledges = tokenizer.batch_decode(output_ids, skip_special_tokens=True)
print(list(set(knowledges)))
Outputs:
Sydney is a good friend to Addison.
Sydney is a kind person.
One should be thankful for the help of others.
Rubbed head is a good way to relieve headaches.
The head is a very sensitive area.
One should be grateful for the help of others.
The head is the most sensitive part of the body.
The person who rubs the head is a good person.
Sydney will be grateful.
The head is a sensitive area.
You may also refer to https://huggingface.co/spaces/liujch1998/rainier/blob/main/app.py#L16-L100 for implementation.
BibTeX:
@article{Liu2022RainierRK,
title={Rainier: Reinforced Knowledge Introspector for Commonsense Question Answering},
author={Jiacheng Liu and Skyler Hallinan and Ximing Lu and Pengfei He and Sean Welleck and Hannaneh Hajishirzi and Yejin Choi},
journal={ArXiv},
year={2022},
volume={abs/2210.03078},
url={https://api.semanticscholar.org/CorpusID:252735191}
}
Jiacheng Liu