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

llmarizer-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.

llmarizer-0.0.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llmarizer-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 llmarizer-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3c22eda2498d3ebd78d8c8c95ba88108b074fef38daf2fdea2a74b6356f6cecc
MD5 c0b79e88764b43d33c4a5196105971c6
BLAKE2b-256 45ee1a1cc3e03aba1b3c1f6267b7c41ca115514b8718a963af73ad02113cf903

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for llmarizer-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 154219adc154432a1d9d347956e0728768fbc0c712c6a0c59030c2b75fac79ba
MD5 569dbe38fe2da7f5ab4bbd6b11ca402e
BLAKE2b-256 03a0d977c5e4c6bcccf42437eea7cd90d6bd46071df3078b2109ee8ea3321a1b

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