Downloads · 30 days
27
0% of all-time downloads
bakhitovd/led-base-7168-ml
led-base-7168-ml is a summarization model from bakhitovd. Use it when you need a shorter version of a longer text. It is set up for transformers. The card lists the license as cc0-1.0.
- GitHub: https://github.com/Bakhitovd/led-base-7168-ml - Model name: bakhitovd/led-base-7168-ml - Model type: Longformer (alenai/led-base-16384) - Model description: This Longformer model has been fine-tuned on a foc…
Downloads · 30 days
27
0% of all-time downloads
All-time downloads
8.5K
Public
Repo size
2.6 GB
Likes
0
Public
Click a slice to open those files.
.pt1.3 GB · 67%
From the Hugging Face model README
This model is intended to be used for text summarization tasks, specifically for summarizing machine learning research papers.
import torch
from transformers import LEDTokenizer, LEDForConditionalGeneration
tokenizer = LEDTokenizer.from_pretrained("bakhitovd/led-base-7168-ml")
model = LEDForConditionalGeneration.from_pretrained("bakhitovd/led-base-7168-ml")
article = "... long document ..."
inputs_dict = tokenizer.encode(article, padding="max_length", max_length=16384, return_tensors="pt", truncation=True)
input_ids = inputs_dict.input_ids.to("cuda")
attention_mask = inputs_dict.attention_mask.to("cuda")
global_attention_mask = torch.zeros_like(attention_mask)
global_attention_mask[:, 0] = 1
predicted_abstract_ids = model.generate(input_ids, attention_mask=attention_mask, global_attention_mask=global_attention_mask, max_length=512)
summary = tokenizer.decode(predicted_abstract_ids, skip_special_tokens=True)
print(summary)
Dataset name: bakhitovd/data_science_arxiv
This dataset is a subset of the 'Scientific papers' dataset, which contains articles semantically, structurally, and meaningfully closest to articles describing machine learning. This subset was obtained using K-means clustering on the embeddings generated by SciBERT.
The model's performance was evaluated using ROUGE metrics and it showed improved performance over the baseline models.
