Skip to main content

aiSSEMBLE Inference Sumy Module

Sumy library integration for text summarization support in the aiSSEMBLE Inference library.

Supported Algorithms

This module supports multiple summarization algorithms through the sumy library:

Algorithm Description
TextRank Graph-based ranking algorithm (default)
LSA Latent Semantic Analysis
LexRank Graph-based ranking with cosine similarity

Installation

pip install aissemble-inference-sumy

This will also install the required dependencies:

  • aissemble-inference-core
  • sumy (text summarization library)
  • nltk (natural language processing toolkit)

Usage

With MLServer

Create a model-settings.json:

{
    "name": "sumy",
    "implementation": "aissemble_inference_sumy.SumyRuntime",
    "parameters": {
        "algorithm": "textrank",
        "sentences_count": 3,
        "language": "english"
    }
}

Start MLServer:

mlserver start /path/to/models

With OIP Client

from aissemble_inference_core.client import InferenceClient
from aissemble_inference_core.client.registry import ModuleRegistry

# The module auto-registers via entry points
print(ModuleRegistry.instance().list_available())
# {'runtimes': ['sumy', ...], 'translators': ['sumy', ...], ...}

# Use with InferenceClient
client = InferenceClient(adapter, endpoint)
result = client.summarize("sumy").text("Long article text...").run()
print(result.summary)

Components

SumyRuntime

MLServer-compatible runtime that wraps sumy summarization algorithms:

  • Accepts text strings via OIP protocol
  • Returns summarized text
  • Configurable algorithm, sentence count, and language via parameters

SumyTranslator

Translator for sumy outputs:

  • Inherits from DefaultSummarizationTranslator
  • Can be extended with sumy-specific optimizations

Configuration Parameters

Parameter Type Default Description
algorithm string "textrank" Summarization algorithm (textrank, lsa, lexrank)
sentences_count int 3 Number of sentences in the summary
language string "english" Language for text tokenization

Note: The max_length and min_length parameters from SummarizationBuilder are not currently supported by this module. This is planned for a future enhancement.

Entry Points

This module registers the following entry points:

Group Name Class
inference.runtimes sumy SumyRuntime
inference.translators sumy SumyTranslator

Language Support

The sumy library supports multiple languages for tokenization and stemming. Specify the language using the language parameter in model-settings.json. Common languages include:

  • english
  • spanish
  • french
  • german
  • italian
  • portuguese
  • russian
  • czech
  • slovak

Refer to the sumy documentation for a complete list of supported languages.

Testing

This module includes comprehensive tests covering:

Unit Tests

  • Module registration and discovery
  • Runtime loading with different algorithms
  • Direct inference via SumyRuntime
  • Translator functionality
  • Error handling and validation

Integration Tests (tagged with @integration)

  • End-to-end OIP communication via MLServer
  • Real HTTP requests using InferenceClient
  • Algorithm switching (TextRank, LSA, LexRank)
  • Parameter configuration validation

Run tests:

# Run all tests (unit + integration)
mvn clean install

# Run only unit tests (excluding @integration tag)
behave --tags=-integration

The integration tests automatically:

  1. Start MLServer with configured models
  2. Execute real inference requests via OIP protocol
  3. Validate responses and summaries
  4. Clean up resources

See tests/features/ for test scenarios and tests/features/environment.py for MLServer test infrastructure.

Example

For a complete working example, see the aissemble-summarization-example in the examples directory:

cd aissemble-inference-examples/aissemble-summarization-example
uv sync --group test
uv run behave

The example demonstrates:

  • MLServer configuration for multiple summarization algorithms
  • Integration with InferenceClient and HttpOipAdapter
  • BDD test patterns for OIP-based applications
  • Sample article data for testing

Metadata

Release files for aissemble-inference-sumy 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aissemble-inference-sumy 1.5.0
File Size Uploaded Provenance Actions
aissemble_inference_sumy-1.5.0.tar.gz 16.2 kB Without provenance Details for aissemble_inference_sumy-1.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aissemble-inference-sumy 1.5.0
File Interpreter ABI Platform Actions
aissemble_inference_sumy-1.5.0-py3-none-any.whl Python 3 none any Details for aissemble_inference_sumy-1.5.0-py3-none-any.whl

Total release size: 28.4 kB

Release files / aissemble_inference_sumy-1.5.0.tar.gz

Download URL aissemble_inference_sumy-1.5.0.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8ae9c16b7b3ae262cfe4e89636500035d26f645a47a8d7ba2c9481147532ac5a
BLAKE2b-256 checksum
How to use checksums
33850ee58137e21c24bbb3de458f2504f993debcb425f2d99628adbf827c6112
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / aissemble_inference_sumy-1.5.0-py3-none-any.whl

Download URL aissemble_inference_sumy-1.5.0-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aeb10bea4d455be32e8d41f18d63db357f6a83450680b358aa1bc8c47638f514
BLAKE2b-256 checksum
How to use checksums
0e9c7ff2a30421a1065393b85c668ca769a66b050809ee846c42b982dd17c59e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for aissemble-inference-sumy 1.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page