How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
# Warning: Pipeline type "summarization" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# 'pip install "transformers<5.0.0'
from transformers import pipeline

pipe = pipeline("summarization", model="aarushi-211/TOS-Longformer")
# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("aarushi-211/TOS-Longformer")
model = AutoModelForSeq2SeqLM.from_pretrained("aarushi-211/TOS-Longformer")
Quick Links

Longformer fine-tuned to summarize Terms of Service

Terms of Service documents are lengthy, complex, and time-consuming to read. Due to its vague language, people often don’t understand what they are agreeing to. Hence, we have fine-tuned Longformer model to help summarize TOS and make it easy to read and understand.

This model is a fine-tuned version of allenai/led-base-16384
Dataset used: TL;DRLegal and TOS;DR website
It achieves the following results on the validation set:

  • ROUGE-1: 0.28
  • ROUGE-2: 0.13
  • ROUGE-L: 0.27

How to Use

from transformers import AutoTokenizer, AutoModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("aarushi-211/TOS-Longformer")
model = AutoModelForSequenceClassification.from_pretrained("aarushi-211/TOS-Longformer")

inputs = tokenizer("Your input text here", return_tensors="pt", truncation=True)
outputs = model(**inputs)
logits = outputs.logits
Downloads last month
2
Safetensors
Model size
0.2B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for aarushi-211/TOS-Longformer

Finetuned
(44)
this model

Space using aarushi-211/TOS-Longformer 1