Skip to main content

A python package for summarizing text using an LLM model.

Project description

LLM Summarizer

LLummarizer is a Python library that provides an interface to the OpenAI GPT-4 model for generating summaries from structured data. This library allows developers to easily integrate summarization capabilities into their applications.

Installation

You can install the LLM Summarizer library using pip:

pip install llummarizer

Usage

Here is a simple example of how to use the LLMSummarizer class:

from llummarizer import LLMSummarizer

# Create an instance of the summarizer
summarizer = LLMSummarizer()

# Define the data to summarize
data = {
    "first_name": "Lewis",
    "last_name": "Hamilton",
    "occupation": "Driver",
    "wins": 100,
    "points": 1000
}

# Optionally, define context and excluded keys
context = {
    "first_name": "Named after Olympic sprinter Carl Lewis",
    "occupation": "Formula 1 racing driver"
}
excluded_keys = ["email"]

# Generate the summary in English (default)
summary_en = summarizer.create_summary(data, context=context, excluded_keys=excluded_keys)

# Generate the summary in Spanish
summary_es = summarizer.create_summary(data, context=context, excluded_keys=excluded_keys, language="spanish")

print("English summary:", summary_en)
print("Spanish summary:", summary_es)

Features

  • Generate summaries from structured data
  • Customize summaries with additional context
  • Exclude specific keys from summarization
  • Support for multiple output languages
  • Powered by OpenAI's GPT-4 model

Requirements

  • Python 3.12 or higher
  • OpenAI API key (set as an environment variable OPENAI_API_KEY)

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llummarizer-0.0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llummarizer-0.0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file llummarizer-0.0.1.tar.gz.

File metadata

  • Download URL: llummarizer-0.0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for llummarizer-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1da74c5551dc0b86278bffc09bd753eaec8ccc7302cb0a01ce58221aac49b606
MD5 6ebca7eb990049c5f7c8fc657f07002c
BLAKE2b-256 45fc5f92f420bfc5f293201288bf35b364fa582423ab668ae6f0bd11d4d2f4e7

See more details on using hashes here.

File details

Details for the file llummarizer-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: llummarizer-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for llummarizer-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b0a8d28597dfe815064b1a74ceaf35379b0d440cad16a14960afd9cfac72a94c
MD5 c781b985d0821bd0ecc37018d3672894
BLAKE2b-256 edf8b6e5cc8e33910cd8fd37342e5d20ac31177418b5d46a13a64322cbb72769

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page