1from transformers import pipeline
2
3model_tag = "postbot/distilgpt2-emailgen"
4generator = pipeline(
5 'text-generation',
6 model=model_tag,
7 )
8
9prompt = """
10Hello,
11
12Following up on the bubblegum shipment."""
13
14result = generator(
15 prompt,
16 max_length=64,
17 do_sample=False,
18 early_stopping=True,
19) # generate
20print(result[0]['generated_text'])
This model is a fine-tuned version of
distilgpt2 on a dataset of 50k emails, including the classic
aeslc dataset.
The intended use of this model is to provide suggestions to "autocomplete" the rest of your email. Said another way, it should serve as a tool to write predictable emails faster. It is not intended to write entire emails; at least some input is required to guide the direction of the model.
Please verify any suggestions by the model for A) False claims and B) negation statements before accepting/sending something.
Detailed results can be found
here