LED-Based Summarization Model: Condensing Long and Technical Information
The Longformer Encoder-Decoder (LED) for Narrative-Esque Long Text Summarization is a model I fine-tuned from
allenai/led-base-16384
to condense extensive technical, academic, and narrative content in a fairly generalizable way.
Key Features and Use Cases
Ideal for summarizing long narratives, articles, papers, textbooks, and other documents.
the sparknotes-esque style leads to 'explanations' in the summarized content, offering insightful output.
High capacity: Handles up to 16,384 tokens per batch.
demos: try it out in the notebook linked above or in the
demo on Spaces
Note:
The API widget has a max length of ~96 tokens due to inference timeout constraints.
Training Details
The model was trained on the BookSum dataset released by SalesForce, which leads to the
bsd-3-clause
license. The training process involved 16 epochs with parameters tweaked to facilitate very fine-tuning-type training (super low learning rate).
There are also other variants on other datasets etc on my hf profile, feel free to try them out :)
Basic Usage
I recommend using
encoder_no_repeat_ngram_size=3
when calling the pipeline object, as it enhances the summary quality by encouraging the use of new vocabulary and crafting an abstractive summary.
wall_of_text = "your words here"
result = summarizer(
wall_of_text,
min_length=8,
max_length=256,
no_repeat_ngram_size=3,
encoder_no_repeat_ngram_size=3,
repetition_penalty=3.5,
num_beams=4,
do_sample=False,
early_stopping=True,
)
print(result[0]["generated_text"])
Simplified Usage with TextSum
To streamline the process of using this and other models, I've developed
a Python package utility
named
textsum
. This package offers simple interfaces for applying summarization models to text documents of arbitrary length.
Install TextSum:
pip install textsum
Then use it in Python with this model:
from textsum.summarize import Summarizer
model_name = "pszemraj/led-base-book-summary"
summarizer = Summarizer(
model_name_or_path=model_name, # you can use any Seq2Seq model on the Hub
token_batch_length=4096, # how many tokens to batch summarize at a time
)
long_string = "This is a long string of text that will be summarized."
out_str = summarizer.summarize_string(long_string)
print(f"summary: {out_str}")
Currently implemented interfaces include a Python API, a Command-Line Interface (CLI), and a shareable demo/web UI.
For detailed explanations and documentation, check the
README
or the
wiki
Runs of pszemraj led-base-book-summary on huggingface.co
1.3K
Total runs
-393
24-hour runs
-432
3-day runs
-542
7-day runs
-322
30-day runs
More Information About led-base-book-summary huggingface.co Model
led-base-book-summary huggingface.co is an AI model on huggingface.co that provides led-base-book-summary's model effect (), which can be used instantly with this pszemraj led-base-book-summary model. huggingface.co supports a free trial of the led-base-book-summary model, and also provides paid use of the led-base-book-summary. Support call led-base-book-summary model through api, including Node.js, Python, http.
led-base-book-summary huggingface.co is an online trial and call api platform, which integrates led-base-book-summary's modeling effects, including api services, and provides a free online trial of led-base-book-summary, you can try led-base-book-summary online for free by clicking the link below.
pszemraj led-base-book-summary online free url in huggingface.co:
led-base-book-summary is an open source model from GitHub that offers a free installation service, and any user can find led-base-book-summary on GitHub to install. At the same time, huggingface.co provides the effect of led-base-book-summary install, users can directly use led-base-book-summary installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
led-base-book-summary install url in huggingface.co: