Skip to main content

Python Package: impresso-pipelines

PyPI Python versions Weekly Downloads Contributors QA Workflow

Overview

This repository contains a Python package designed for modular and efficient text processing workflows. Currently, it includes the following subpackages:

  • Language Identification Pipeline: Identifies the language of input text and returns a probability score.
  • OCR QA Pipeline: Assesses the quality of OCR text by estimating the proportion of recognized vocabulary items (0–1), using efficient language-specific Bloom filters.
  • LDA Topic Modeling Pipeline: Soft clustering of input texts using LDA-based topic modeling.
  • News Agencies Pipeline: Extracts and ranks news agency entities from text, providing relevance scores and optional links to Wikidata.
  • Advertisement Classifier: Identifies advertisements in historical newspaper content using a fine-tuned XLM-RoBERTa model with rule-based features.
  • Lucene/Solr normalization Pipeline: Replicates Solr's language-specific text normalization to clarify how input text is tokenized and indexed in impresso.

Installation

uv is an extremely fast Python package installer (10-100x faster than pip):

# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install the package with all dependencies
uv pip install "impresso-pipelines[all]"

Standard Install (with pip)

To install the full package with all submodules:

pip install "impresso-pipelines[all]"

The [all] extra installs all dependencies required for each component.

Install Individual Modules

To install individual modules without unnecessary dependencies, use:

pip install "impresso-pipelines[langident]"         # Language Identification
pip install "impresso-pipelines[ocrqa]"             # OCR QA
pip install "impresso-pipelines[ldatopics]"         # LDA Topics
pip install "impresso-pipelines[newsagencies]"      # News Agencies
pip install "impresso-pipelines[mediaagencies]"    # Media Agencies NER
pip install "impresso-pipelines[adclassifier]"      # Advertisement Classifier
pip install "impresso-pipelines[solrnormalization]" # Solr text normalization

Development Setup

For contributors, we support both uv (faster) and Poetry:

# Clone the repository
git clone https://github.com/impresso/impresso-pipelines.git
cd impresso-pipelines

# Option 1: Using uv (recommended - 3-6x faster)
uv sync --extra all --extra dev

# Option 2: Using Poetry
poetry install --all-extras --with dev

# Or use Make (auto-detects uv or Poetry)
make install-dev

See UV_MIGRATION.md for more details on using uv.

Usage

Each pipeline is instantiated from a corresponding class.

from impresso_pipelines.langident import LangIdentPipeline
from impresso_pipelines.ocrqa import OCRQAPipeline
from impresso_pipelines.ldatopics import LDATopicsPipeline
from impresso_pipelines.newsagencies import NewsAgenciesPipeline
from impresso_pipelines.mediaagencies import MediaAgenciesPipeline
from impresso_pipelines.adclassifier import AdClassifierPipeline
from impresso_pipelines.solrnormalization import SolrNormalizationPipeline

Pipeline Examples

For usage examples, refer to the individual README files:

See also the interactive notebooks for further examples:

Future Plans

Additional functionality will be added to extend use cases and support further processing tasks.

Local Development

For contributors and developers who want to test locally before pushing to GitHub:

Quick Start

# Clone and install
git clone https://github.com/impresso/impresso-pipelines.git
cd impresso-pipelines

# Option 1: Poetry (recommended for full development)
make install-dev

# Option 2: Pip editable mode (faster for testing changes)
make install-editable-dev

# Run tests
make test

# Run all QA checks (mimics CI)
make qa

Available Commands

make help              # Show all available commands
make install          # Install package with all extras
make install-dev      # Install with dev dependencies
make test             # Run tests (skipping JVM tests)
make test-all         # Run all tests including JVM tests
make test-ocrqa       # Run only OCRQA tests
make test-cov         # Run tests with coverage report
make lint             # Run linting checks
make format           # Format code with black
make type-check       # Run type checking
make qa               # Run all QA checks
make clean            # Remove build artifacts

For detailed development instructions, see CONTRIBUTING.md.

About Impresso

Impresso project

Impresso - Media Monitoring of the Past is an interdisciplinary research project that aims to develop and consolidate tools for processing and exploring large collections of media archives across modalities, time, languages and national borders. The first project (2017-2021) was funded by the Swiss National Science Foundation under grant No. CRSII5_173719 and the second project (2023-2027) by the SNSF under grant No. CRSII5_213585 and the Luxembourg National Research Fund under grant No. 17498891.

Copyright (C) 2025 The Impresso team.

License

This program is provided as open source under the GNU Affero General Public License v3 or later.


Impresso Project Logo

Metadata

Release files for impresso-pipelines 0.6.1.3

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

Source distribution (sdist)

Source distribution for impresso-pipelines 0.6.1.3
File Size Uploaded Provenance Actions
impresso_pipelines-0.6.1.3.tar.gz 91.0 kB Without provenance Details for impresso_pipelines-0.6.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for impresso-pipelines 0.6.1.3
File Interpreter ABI Platform Actions
impresso_pipelines-0.6.1.3-py3-none-any.whl Python 3 none any Details for impresso_pipelines-0.6.1.3-py3-none-any.whl

Total release size: 194.8 kB

Release files / impresso_pipelines-0.6.1.3.tar.gz

Download URL impresso_pipelines-0.6.1.3.tar.gz
Size 91.0 kB
Tags Source
SHA-256 checksum
How to use checksums
93afda19948d5cfc897fd2d3fd168d0bfec7af6bad6ba2a79cb54da54238e40f
BLAKE2b-256 checksum
How to use checksums
46a5e1876f0a280cd6d9e9f7f9bc8b71fa0648fa6044ed0425a3201d9b3960b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / impresso_pipelines-0.6.1.3-py3-none-any.whl

Download URL impresso_pipelines-0.6.1.3-py3-none-any.whl
Size 103.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3588fe6404d16d617a73fd64f1e5d54ed63d018d793352259048acd3d5fe250
BLAKE2b-256 checksum
How to use checksums
f6e5c41f04e446979788c4fdac570c8f6ad54d777ac89da76e288abca003f1f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for impresso-pipelines 0.6.1.3

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.

Release history Release notifications | RSS feed

This release

0.6.1.3 This release

2 release files No provenance

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