Downloads · 30 days
10
1% of all-time downloads
IrisWiris/email-summarizer
email-summarizer is a machine learning model from IrisWiris. 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 Model takes in an email and provides a quick summary.
Downloads · 30 days
10
1% of all-time downloads
All-time downloads
679
Public
Parameters
77M
309 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors308 MB · 99%
From the Hugging Face model README
This Model takes in an email and provides a quick summary.
How to use on google colab:
#Install dependencies
!pip install transformers
#Load the model and tokenizer
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("IrisWiris/email-summarizer")
model = AutoModelForSeq2SeqLM.from_pretrained("IrisWiris/email-summarizer")
#Summarize an email
email =
"""
paste the email
"""
inputs = tokenizer(email, return_tensors="pt", truncation=True)
outputs = model.generate(inputs.input_ids, max_length=100)
summary = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(summary)
email = """
Good morning,
I hope this message finds you well. Unfortunately, I am unwell and will not be able to hold today's lecture or any classes for the remainder of this week. As a result, all classes are canceled.
However, I uploaded a document that you should review before classes resume next week as scheduled.
Please ensure you go through the material, as it will be important for our upcoming discussions.
Thank you for your understanding, and I look forward to seeing you next week.
Best regards,
James
"""
inputs = tokenizer(email, return_tensors="pt", truncation=True)
outputs = model.generate(inputs.input_ids, max_length=100)
summary = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(summary)
Output:
James is unwell and will not hold today's lecture or any classes for the remainder of this week. He uploaded a document that will review the material before classes resume next week as scheduled.
As a university student, I get a lot of emails. Unforunatly I have to read each and every one, because among a lot of unessary information there exist a few important notes. To make the email reading process less tedious, I have trained this model to summarize an email input.
Used argilla/FinePersonas-Conversations-Email-Summaries: https://huggingface.co/datasets/argilla/FinePersonas-Conversations-Email-Summaries
All code used was taught to me by Shiftkey Labs' GenAI Course: https://shiftkeylabs.ca/