Source Resegmenter
source_resegmenter is a Python library for re-segmenting a text into lines in a way
that it matches a reference text in another language.
The repository is tested using Python 3.11. Although it may work also with other Python versions, we do not ensure compatibility with them. Check out the Usage section for instructions on how to use the repository and the Installation section for further information about how to install the project.
Installation
You can install the latest stable version from PyPI:
pip install source_resegmenter
Or, to install from source:
git clone https://github.com/hlt-mt/source_resegmenter.git
cd source_resegmenter
pip install .
For development (with docs and testing tools):
pip install -e .[dev]
Usage
This library assumes that 3 txt files are available:
- The source text to be re-segmented, whose segmentation into lines has to be refined to match that of a reference file;
- The reference text, to which we want to obtain a line-level alignment of the source text;
- A backtranslation of the reference text into the source language, aligned at the line level with the reference text.
Once these three txt files are available, this tool can be used from command line as:
source_resegmenter --source-texts asr_audio_1.en --reference-texts audio_1_ref.it \
--backtranslation-texts mt_audio_1_ref.en --output resegm_audio_1.en
Contributing
Contributions from interested researchers and developers are extremely appreciated.
You can create an issue in case of problems with the code, questions, or feature requests. You are also more than welcome to create a pull request that addresses any issue.
Licence
source_resegmenter_ is licensed under Apache Version 2.0.
Credits
If you use this library, please cite:
@inproceedings{cettolo-et-al-2025-xlr-segmenter,
title={{How to Evaluate Speech Translation with Source-Aware Neural MT Metrics}},
author={Cettolo, Mauro and Gaido, Marco and Negri, Matteo and Papi, Sara and Bentivogli, Luisa},
booktitle = "",
address = "",
year={2025}
}
Metadata
Release files for source-resegmenter 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| source_resegmenter-1.0.0.tar.gz | 17.5 kB | Without provenance | Details for source_resegmenter-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| source_resegmenter-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for source_resegmenter-1.0.0-py3-none-any.whl |
Total release size: 35.7 kB
Release files / source_resegmenter-1.0.0.tar.gz
| Download URL | source_resegmenter-1.0.0.tar.gz |
|---|---|
| Size | 17.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1c7189c15d740d5a28d6aa83076c6585650bd6ee82e1122eb62a2c25186460e4
|
|
BLAKE2b-256 checksum How to use checksums |
f03a40bf65c502ae6e5666ff00422eec1a7f3d0538af624be8905cbebff29bc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / source_resegmenter-1.0.0-py3-none-any.whl
| Download URL | source_resegmenter-1.0.0-py3-none-any.whl |
|---|---|
| Size | 18.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2166035a06db241d0097ae63735e90eea6b503bd1e2032507d9698477e24e067
|
|
BLAKE2b-256 checksum How to use checksums |
2c0ba01d43660a40761daab11a09ed2961ce6e812dfe3cbc0d6b4bd39cb85240
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Security for source-resegmenter 1.0.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.