No project description provided
Project description
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
- Model name:
- 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
- Model name:
- 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
- Model name:
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](https://github.com/sobamchan/schnitsum/blob/main/examples/docs.txt)
> 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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
schnitsum-0.4.0.tar.gz
(7.0 kB
view hashes)
Built Distribution
Close
Hashes for schnitsum-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdb26eb3b99a147c84262372317d711df355cd2394c43243023ac1d65063084b |
|
MD5 | 5e8aa176cf8a274a7e7a8f0b0af41c53 |
|
BLAKE2b-256 | 87f9a803a6248bc7e5a8a40e03f080854732f977b811e17a1f6e36d4ff6b181a |