Skip to content

sobamchan/schnitsum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Schnitsum: Easy to use neural network based summarization models

This package enables to generate summaries of you documents of interests.

Currently, we support following models,

  • BART (large) fine-tuned on computer science papers (ref. SciTLDR).
    • Model name: sobamchan/bart-large-scitldr
  • BART (large) fine-tuned on computer science papers (ref. SciTLDR). Then distilled (by shrink and fine-tune) to have 65% parameters less.
    • Model name: sobamchan/bart-large-scitldr-distilled-3-3
  • BART (large) fine-tuned on computer science papers (ref. SciTLDR). Then distilled (by shrink and fine-tune) to have 37% parameters less.
    • Model name: sobamchan/bart-large-scitldr-distilled-12-3
  • mBART (large, en-to-de) fine-tuned on computer science papers, English papers and German summaries (ref. X-SciTLDR).
    • Model name: sobamchan/mbart-large-xscitldr-de
  • BART (large) fine-tuned on XSum, BCC news article lead sentences in English. (ref. X-SciTLDR).
    • Model name: facebook/bart-large-xsum

we are planning to expand coverage soon to other sizes, domains, languages, models soon.

Installation

pip install schnitsum  # or poetry add schnitsum

This will let you generate summaries with CPUs only, if you want to utilize your GPUs, please follow the instruction by PyTorch, here.

Usage

From Command Line

Pass document as an argument and print the summary

> schnitsum --model-name sobamchan/bart-large-scitldr-distilled-3-3 --text "Text to summarize"

Pass documents as a file and save summaries in a file. Input file needs to contain documents line by line. example

> schnitsum --model-name sobamchan/bart-large-scitldr-distilled-3-3 --file docs.txt --opath sums.txt

From Python

from schnitsum import SchnitSum

model = SchnitSum("sobamchan/bart-large-scitldr-distilled-3-3")
docs = [
    "Document you want to summarize."
]
summaries = model(docs)
print(summaries)

About

Easy to use summarization package

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages