Downloads · 30 days
225
2% of all-time downloads
allenai/tailor
tailor is a machine learning model from allenai. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
This is a ported version of Tailor, the general-purpose counterfactual generator. For more code release, please refer to this github page.
Downloads · 30 days
225
2% of all-time downloads
All-time downloads
10.3K
Public
Repo size
1.8 GB
Likes
2
Public
Click a slice to open those files.
.bin892 MB · 100%
From the Hugging Face model README
This is a ported version of Tailor, the general-purpose counterfactual generator. For more code release, please refer to this github page.
from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM
model_path = "allenai/tailor"
generator = pipeline("text2text-generation",
model=AutoModelForSeq2SeqLM.from_pretrained(model_path),
tokenizer=AutoTokenizer.from_pretrained(model_path),
framework="pt", device=0)
prompt_text = "[VERB+active+past: comfort | AGENT+complete: the doctor | PATIENT+partial: athlete | LOCATIVE+partial: in] <extra_id_0> , <extra_id_1> <extra_id_2> <extra_id_3> ."
generator(prompt_text, max_length=200)
@misc{ross2021tailor,
title={Tailor: Generating and Perturbing Text with Semantic Controls},
author={Alexis Ross and Tongshuang Wu and Hao Peng and Matthew E. Peters and Matt Gardner},
year={2021},
eprint={2107.07150},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2107.07150},
}