Customizing Your Summaries

Eric @ CodableAI

Last Update vor 2 Jahren

Overview

The Document Summarization API offers a range of customization options to ensure that the generated summaries align perfectly with your application's needs. This guide explores how to adjust summary formats, tones, lengths, types, and translation options to create tailored summaries.

Contents
  • Summary Formats (e.g., Bullet Points, Paragraph)

    Choose the format that best suits your application's presentation style or user preference.

    • bullet_points:

      Generates a list of concise bullet points highlighting key information.

      Example:

      jsonCopy code"format": "bullet_points"

      Summary Output:

      diffCopy code- AI enhances diagnostic accuracy in healthcare. - Machine learning optimizes treatment plans. - AI-driven tools improve patient monitoring and care.
    • paragraph:

      Produces a cohesive paragraph summarizing the main points.

      Example:

      jsonCopy code"format": "paragraph"

      Summary Output:

      csharpCopy codeAI enhances diagnostic accuracy in healthcare, optimizes treatment plans through machine learning, and improves patient monitoring and care with AI-driven tools.
    • executive:

      Provides a high-level overview suitable for executive reports or briefings.

      Example:

      jsonCopy code"summary_type": "executive"

      Summary Output:

      csharpCopy codeArtificial Intelligence significantly improves healthcare by enhancing diagnostic accuracy, optimizing treatment plans through machine learning algorithms, and streamlining patient monitoring and care processes.
  • Tone Customization (e.g., Neutral, Formal)

    Adjust the tone of the summary to match the desired style or audience.

    • neutral:

      A balanced and objective tone.

      jsonCopy code"customization": { "tone": "neutral" }
    • formal:

      A professional and formal tone suitable for official documents.

      jsonCopy code"customization": { "tone": "formal" }
    • informal:

      A casual and conversational tone.

      jsonCopy code"customization": { "tone": "informal" }
    • energetic:

      A lively and enthusiastic tone.

      jsonCopy code"customization": { "tone": "energetic" }
    • calm:

      A soothing and composed tone.

      jsonCopy code"customization": { "tone": "calm" }
  • Adjusting Summary Length

    Control the verbosity of the generated summary by setting the desired length.

    • short:

      A brief summary capturing only the most critical points.

      jsonCopy code"customization": { "summary_length": "short" }
    • standard:

      A balanced summary with sufficient detail.

      jsonCopy code"customization": { "summary_length": "standard" }
    • detailed:

      An in-depth summary providing comprehensive coverage of the content.

      jsonCopy code"customization": { "summary_length": "detailed" }
  • Selecting Summary Types (e.g., Executive, Conversation)

    Define the purpose and style of the summary based on the context.

    • executive:

      High-level overview suitable for decision-makers.

      jsonCopy code"summary_type": "executive"
    • conversation:

      Focuses on summarizing dialogues or conversational content.

      jsonCopy code"summary_type": "conversation"
    • bullet_points:

      Highlights key points in a list format.

      jsonCopy code"summary_type": "bullet_points"
    • paragraph:

      Generates a continuous paragraph summarizing the content.

      jsonCopy code"summary_type": "paragraph"
  • Translating Summaries into Supported Languages

    Extend the reach of your summaries by translating them into multiple languages.

    • Supported Languages:

      The API supports the top 25 languages by native speakers, including but not limited to:

      • English (en)
      • Spanish (es)
      • French (fr)
      • German (de)
      • Mandarin (zh)
      • ... (other language codes)
    • Setting the Target Language:

      Use the target_language parameter to specify the desired language code.

      Example:

      jsonCopy code"target_language": "es"

      This will translate the generated summary into Spanish.

    • Combining Translation with Other Customizations:

      You can combine translation with other customization options for comprehensive tailoring.

      Example:

      jsonCopy code{ "text": "Artificial Intelligence is transforming the world by enhancing various industries...", "format": "bullet_points", "customization": { "tone": "neutral", "summary_length": "standard" }, "target_language": "fr" }

      Summary Output:

      vbnetCopy code- L'IA améliore l'exactitude diagnostique dans le secteur de la santé. - Les algorithmes d'apprentissage automatique optimisent les plans de traitement. - Les outils alimentés par l'IA améliorent la surveillance et les soins aux patients.
  • Practical Examples:

    • Example 1: Formal, Executive Summary in English

      jsonCopy code{ "text": "Artificial Intelligence is transforming the world by enhancing various industries...", "summary_type": "executive", "customization": { "tone": "formal", "summary_length": "standard" } }
    • Example 2: Informal, Bullet Points Summary in Spanish

      jsonCopy code{ "text": "Artificial Intelligence is transforming the world by enhancing various industries...", "format": "bullet_points", "customization": { "tone": "informal", "summary_length": "short" }, "target_language": "es" }
    • Example 3: Detailed Paragraph Summary in German with Query

      jsonCopy code{ "text": "Artificial Intelligence is transforming the world by enhancing various industries...", "format": "paragraph", "customization": { "summary_length": "detailed", "tone": "neutral" }, "summary_type": "executive", "query": "How is AI impacting the healthcare industry?", "target_language": "de" }
Next Steps

With customization techniques under your belt, proceed to the next article, "Handling API Responses Effectively," to learn how to interpret and utilize the summaries generated by the API.

Was this article helpful?

0 out of 0 liked this article