Catalog PyPI
Back to packageRELEASE DETAILS

0.2.0

PyPI

abtranslate

A translator wrapper for open-source translation models with batch optimization. Currently supports ArgosTranslate models and is designed for scalable deployment.

Published7 Oct 2025
Direct dependencies7
Transitive dependenciesNot calculated

README

Version 0.2.0 documentation

ABTranslate

A translator wrapper for open-source translation models with batch optimization. Currently supports ArgosTranslate models and is designed for scalable deployment.

Features

  • ✅ Optimized translation for list or pandas.Series of text
  • 🛡️ Supports masking of specific patterns to exclude them from translation
  • ⚙️ Thread-tuned for multi-threaded deployment with ctranslate2
  • 📦 Compatible with ArgosTranslate model packages

Installation

pip install abtranslate

Usage

from abtranslate import load_argostranslate_model

# Load model from local path
model_package = load_argostranslate_model(model_path, package_dir=package_extraction_dir)

# Load translator with optional optimizations
translator = model_package.load_translator(optimized_config=True, lazy_load=False)

# Define translation quality settings (based on CTranslate2)
QUALITY_CONFIG = {
    "beam_size": 4,
    "num_hypotheses": 1,
    "replace_unknowns": True,
}

# Translate a batch of texts (e.g. pandas Series or list)
translated_texts = translator.translate_batch(df["input_text"], translation_config=QUALITY_CONFIG)

🔗 Refer to CTranslate2 Translate Batch Parameters for more configuration options.

Main Functions

  • load_argostranslate_model(model_path: str, package_dir: str) -> ModelPackage: Loads and prepares an ArgosTranslate model for usage.

  • ModelPackage.load_translator(translator_config: dict, optimized_config: bool, lazy_load: bool) -> Translator: Returns a translator instance with optional optimizations.

  • Translator.translate_batch(text_list: List[str] | pd.Series, translation_config: dict, return_type: any) -> List[str]: Performs high-performance batch translation with support for multi-threading and tuning.

License

MIT

Author

Ichsan Takwa GitHub

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 7

Native requirements
7 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
ctranslate2
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
ctranslate2>=3.17.0runtime
pandas
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pandas>=2.3.0runtime
pytest
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pytest>=8.4.1runtime
sentencepiece
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
sentencepiece>=0.2.0runtime
stanza
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
stanza==1.1.1runtime
regex
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
regex>=2024.11.6runtime
build
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
build>=1.3.0runtime

Distribution files

2 collected
abtranslate-0.2.0-py3-none-any.whl

bdist_wheel · 26.79 KB · Python py3

Source file
abtranslate-0.2.0.tar.gz

sdist · 23.66 KB · Python source

Source file

Repository

PENDING
ichsan-t45/abtranslate

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:45 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:fd028437d8c241a62054e2b41a683f5b8ca8a1bf201c7264af03496c557d1699

Other collected versions

View all collected versions →