Buckets:
| ## Summarization | |
| Summarization is the task of producing a shorter version of a document while preserving its important information. Some models can extract text from the original input, while other models can generate entirely new text. | |
| > [!TIP] | |
| > For more details about the `summarization` task, check out its [dedicated page](https://huggingface.co/tasks/summarization)! You will find examples and related materials. | |
| ### Recommended models | |
| - [facebook/bart-large-cnn](https://huggingface.co/facebook/bart-large-cnn): A strong summarization model trained on English news articles. Excels at generating factual summaries. | |
| - [Falconsai/medical_summarization](https://huggingface.co/Falconsai/medical_summarization): A summarization model trained on medical articles. | |
| Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=summarization&sort=trending), or from the terminal with the [`hf` CLI](https://huggingface.co/docs/huggingface_hub/package_reference/cli#hf-models-list): | |
| ```bash | |
| hf models ls --warm --pipeline-tag summarization --sort trending_score | |
| ``` | |
| ### Using the API | |
| <InferenceSnippet | |
| pipeline=summarization | |
| providersMapping={ {"hf-inference":{"modelId":"human-centered-summarization/financial-summarization-pegasus","providerModelId":"human-centered-summarization/financial-summarization-pegasus"}} } | |
| /> | |
| ### API specification | |
| #### Request | |
| | Headers | | | | |
| | :--- | :--- | :--- | | |
| | **authorization** | _string_ | Authentication header in the form `'Bearer: hf_****'` when `hf_****` is a personal user access token with "Inference Providers" permission. You can generate one from [your settings page](https://huggingface.co/settings/tokens/new?ownUserPermissions=inference.serverless.write&tokenType=fineGrained). | | |
| | Payload | | | | |
| | :--- | :--- | :--- | | |
| | **inputs*** | _string_ | The input text to summarize. | | |
| | **parameters** | _object_ | | | |
| | ** clean_up_tokenization_spaces** | _boolean_ | Whether to clean up the potential extra spaces in the text output. | | |
| | ** truncation** | _enum_ | Possible values: do_not_truncate, longest_first, only_first, only_second. | | |
| | ** generate_parameters** | _object_ | Additional parametrization of the text generation algorithm. | | |
| #### Response | |
| | Body | | | |
| | :--- | :--- | :--- | | |
| | **summary_text** | _string_ | The summarized text. | | |
Xet Storage Details
- Size:
- 2.53 kB
- Xet hash:
- 14cbe9613bab6f0a8f36d549d9310ae04ee74f124839aa22e213aacc8e425a94
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.