Giter VIP home page Giter VIP logo

text-summarization-api's Introduction

Translate and Summarize API

The Translate and Summarize API allows you to summarize content, whether it's in the form of raw text, URL, or file, and offers the additional option to translate the content before summarization. With flexible options for extractive and abstractive summarization methods, as well as seamless translation capabilities.

Key Features

  • Summarize content: Generate summaries of text-based content.
  • Choose summarization methods: Benefit from extractive or abstractive summarization methods based on your specific requirements.
  • Seamlessly translate content: Optionally translate the content before the summarization process, allowing for analysis in different languages.
  • Support for various content types: Summarize text, URLs, or files, enabling versatility in data sources and use cases.

Summarizing Content Extractive

To summarize content extractive, make a POST request to the /summarizeExtractive endpoint, providing the content in the request body. You can specify the content as raw text, a URL, or a file.

Example request body:

{
  "content": "Enter your content here"
}

Optionally, you can include additional parameters in the request body: a

  • sentences (optional): Specify the number of sentences of the summarized text.
  • to_language (optional): Specify the language to translate the content before summarization (e.g., "fr" for French).

Response

The API will respond with a JSON object containing the summarized content and text language:

{
  "summary": "This is the summarized content."
  "language": "Text language"
}

Examples

Here are some examples demonstrating how to use the Translate and Summarize API in different scenarios.

Example 1: Summarize raw text and translate to german

POST /summarizeExtractive
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "content": "Enter your content here"
  "to_language": "de"
}

Example 2: Summarize url

POST /summarizeExtractive
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "content": "https://www.example.com"
}

Example 3: Summarize file and specify the summarization length

POST /summarizeExtractive
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "content": "file.txt"
  "sentences": 4
}

Summarizing Content Abstractive

To summarize content abstractive, make a POST request to the /summarizeAbstractive endpoint, providing the content in the request body. You can specify the content as raw text, a URL, or a file.

Example request body:

{
  "content": "Enter your content here"
}

Optionally, you can include additional parameters in the request body: a

  • min_length (optional): Specify the minimum length of the summary (e.g., 10).
  • max_length (optional): Specify the maximum length of the summary (e.g., 100).
  • to_language (optional): Specify the language to translate the content before summarization (e.g., "fr" for French).

Response

The API will respond with a JSON object containing the summarized content and text language:

{
  "summary": "This is the summarized content."
  "language": "Text language"
}

Examples

Here are some examples demonstrating how to use the Translate and Summarize API in different scenarios.

Example 1: Summarize raw text and translate to german

POST /summarizeAbstractive
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "content": "Enter your content here"
  "to_language": "de"
}

Example 2: Summarize url

POST /summarizeAbstractive
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "content": "https://www.example.com"
}

Example 3: Summarize file and specify the summarization length

POST /summarizeAbstractive
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "content": "file.txt"
  "min_length": 150
  "max_length": 200
}

Get Supported Languages for Translation

To get supported languages for translation, make a GET request to the /getSupportedLanguages endpoint

Translate Content

To translate content, make a POST request to the /translate endpoint, providing the content in the request body. You can specify the content as raw text, a URL, or a file.

Example request body:

{
  "content": "Enter your content here"
  "target": "fr"
}

Response

The API will respond with a JSON object containing the summarized content and text language:

{
  "translation": "This is the translated content."
  "from_language": "Text language"
  "to_language": "Target language"
}

Examples

Here are some examples demonstrating how to use the Translate and Summarize API in different scenarios.

Example 1: Translate raw text and translate to german

POST /translate
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "content": "Enter your content here"
  "target": "de"
}

Example 2: Translate url

POST /summarizeExtractive
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "content": "https://www.example.com"
  "target": "tk"
}

Example 3: Translate file

POST /summarizeExtractive
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "content": "file.txt"
  "sentences": 4
}

text-summarization-api's People

Contributors

mustafa-mun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ibraabukaff

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.