sumy model family support for aiSSEMBLE Inference
Project description
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-coresumy(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:
- Start MLServer with configured models
- Execute real inference requests via OIP protocol
- Validate responses and summaries
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aissemble_inference_sumy-1.5.0.tar.gz.
File metadata
- Download URL: aissemble_inference_sumy-1.5.0.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ae9c16b7b3ae262cfe4e89636500035d26f645a47a8d7ba2c9481147532ac5a
|
|
| MD5 |
1a25d46816c542de1b5d34ed536736d8
|
|
| BLAKE2b-256 |
33850ee58137e21c24bbb3de458f2504f993debcb425f2d99628adbf827c6112
|
File details
Details for the file aissemble_inference_sumy-1.5.0-py3-none-any.whl.
File metadata
- Download URL: aissemble_inference_sumy-1.5.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aeb10bea4d455be32e8d41f18d63db357f6a83450680b358aa1bc8c47638f514
|
|
| MD5 |
d7642a996b82f2aa74e30c01c7662cf9
|
|
| BLAKE2b-256 |
0e9c7ff2a30421a1065393b85c668ca769a66b050809ee846c42b982dd17c59e
|