The Bart large CNN model, published by Meta AI, is a fine-tuned version of BART specifically trained for summarization tasks using the CNN/Daily Mail dataset. It is one of the best pre-trained models available for abstractive text summarization.
The Summarization API endpoint allows you to summarize the input text in a few words.
Summarization is a Text Generation task. This technology refers to the process of generating shortened versions of long texts by extracting the main points, ideas, and important information. This involves using techniques from Machine Learning to understand the original content and distill it down into a condensed format.
AI Endpoints makes it easy, with ready-to-use inference APIs. Discover how to use them:
This Summarization API is based on an Open-Source model: facebook/bart-large-cnn. It takes text as input and returns his summary in a few lines.
Model configuration:
The Summarization endpoint offers you an optimized way to generate a shortened version of your text. Learn how to use them with the following example:
First install the requests library:
pip install requests
Next, export your access token to the OVH_AI_ENDPOINTS_ACCESS_TOKEN environment variable:
export OVH_AI_ENDPOINTS_ACCESS_TOKEN=<your-access-token>
If you do not have an access token key yet, follow the instructions in the AI Endpoints – Getting Started.
Finally, run the following Python code:
import os
import requests
url = f"https://bart-large-cnn.endpoints.kepler.ai.cloud.ovh.net/api/summarize"
text = 'Deep learning is the subset of machine learning methods based on artificial neural networks (ANNs) with representation learning. \
The adjective "deep" refers to the use of multiple layers in the network. Methods used can be either supervised, \
semi-supervised or unsupervised.Deep-learning architectures such as deep neural networks, deep belief networks, \
recurrent neural networks, convolutional neural networks and transformers have been applied to fields including computer vision, \
speech recognition, natural language processing, machine translation, bioinformatics, drug design, medical image analysis, \
climate science, material inspection and board game programs, where they have produced results comparable to and in some cases surpassing human expert performance. \
Artificial neural networks were inspired by information processing and distributed communication nodes in biological systems. \
ANNs have various differences from biological brains. Specifically, artificial neural networks tend to be static and symbolic, \
while the biological brain of most living organisms is dynamic (plastic) and analog. ANNs are generally seen as low quality models for brain function.'
headers = {
"Content-Type": "text/plain",
"Authorization": f"Bearer {os.getenv('OVH_AI_ENDPOINTS_ACCESS_TOKEN')}",
}
response = requests.post(url, data=text, headers=headers)
if response.status_code == 200:
# Handle response
response_data = response.text
print(response_data)
else:
print("Error:", response.status_code, response.text)
When using AI Endpoints, the following rate limits apply:
If you exceed this limit, a 429 error code will be returned.
If you require higher usage, please get in touch with us to discuss increasing your rate limits.
For a broader overview of AI Endpoints, explore the full AI Endpoints Documentation.
Reach out to our support team or join the OVHcloud Discord #ai-endpoints channel to share your questions, feedback, and suggestions for improving the service, to the team and the community.
New to AI Endpoints? This guide walks you through everything you need to get an access token, call AI models, and integrate AI APIs into your apps with ease.
Start TutorialExplore what AI Endpoints can do. This guide breaks down current features, future roadmap items, and the platform's core capabilities so you know exactly what to expect.
Start TutorialRunning into issues? This guide helps you solve common problems on AI Endpoints, from error codes to unexpected responses. Get quick answers, clear fixes, and helpful tips to keep your projects running smoothly.
Start TutorialLearn how to use Structured Output with OVHcloud AI Endpoints.
Start TutorialLearn how to use Function Calling with OVHcloud AI Endpoints.
Start TutorialLearn how to use OVHcloud AI Endpoints Virtual Models.
Start TutorialUnlock emotional insights from text using AI! This tutorial shows you how to build a Java-based sentiment analyzer with Quarkus and the powerful GoEmotions model.
Start TutorialLearn how to use Structured Output with Java, LangChain4j and OVHcloud AI Endpoints.
Start TutorialLearn how to use Function Calling with Java, LangChain4j and OVHcloud AI Endpoints.
Start TutorialLearn how to use Model Context Protocol (MCP) with Java, LangChain4j and OVHcloud AI Endpoints.
Start Tutorial