Skip to content

feat: add a base version of the translation pipeline#2

Merged
fmueller merged 18 commits intomainfrom
feat/add-translation-pipeline
Dec 17, 2025
Merged

feat: add a base version of the translation pipeline#2
fmueller merged 18 commits intomainfrom
feat/add-translation-pipeline

Conversation

@fmueller
Copy link
Copy Markdown
Owner

No description provided.

- Implement `_restore_markdown_structure` to fix blockquotes, list markers, and headings.
- Add constraints for exact Markdown preservation during post-editing validation.
- Introduce unit tests to verify consistent restoration of Markdown elements.
- Introduced `--postedit-model` and `--postedit-temperature` CLI options for enhanced control over post-editing in the translation pipeline.
- Introduced `--device` flag to specify hardware for translation models (e.g., auto, CPU, GPU).
- Updated `MTTranslator` to dynamically handle device selection in translation pipelines.
- Introduced `--verbose` flag to display progress messages during CLI execution.
- Added a `reporter` in the translation pipeline to provide live feedback on processing stages.
- Updated block translation workflow to include detailed progress updates, enhancing transparency.
- Auto-detect device (CPU/GPU) using PyTorch without relying on `accelerate`.
- Replace `device_map="auto"` with explicit device assignment in `pipeline`.
- Streamlined device detection logic for translation pipelines using PyTorch.
- Updated tests to reflect the correct `brief` module import path.
- Added `--project` option to load translation defaults from project YAML files.
- Made `--src`, `--tone`, and `--audience` optional if project defaults are provided.
- Enhanced error handling for missing or invalid project configurations.
- Updated `translate` command to resolve configuration from project or CLI input.
- Introduced unit tests to validate project integration and argument precedence.
- Simplified `ToneProfile` by removing unused `voice` and `humor` attributes.
- Updated CLI to exclude `--voice` and `--humor` options, streamlining user input.
- Adjusted dependent logic and messaging to align with the revised tone structure.
- Introduced `--postedit-max-chars` CLI option to limit the size of post-edit prompts.
- Added prompt length and timeout guards to prevent post-edit errors.
- Enhanced `LLMPostEditor` with input trimming to fit character budgets.
- Updated translation pipeline to handle post-edit aborts gracefully.
- Added unit tests for input trimming, timeout handling, and prompt length guards.
- Introduced `_build_output_validator` to enforce placeholder presence and Markdown structure in edited outputs.
- Added `_leading_markdown_marker` helper for validating Markdown prefixes.
- Enhanced `_invoke` method to include validation logic for placeholders, line drift, and Markdown preservation.
- Updated unit tests to cover output validation edge cases.
- Introduced `translate_blocks` method in `MTTranslator` for batch processing, improving efficiency.
- Refactored `_run_step` to `_run_step_batch` to handle batch translations.
- Enhanced progress reporting with `_report_block` to provide detailed block-level feedback.
- Updated translation pipeline to process translatable blocks in batches while maintaining order.
- Adjusted unit tests to validate batch translation behavior and new reporting functionality.
- Integrated language detection using `fast-langdetect` for post-editing outputs.
- Enhanced `_build_output_validator` to verify expected language, ensuring output matches target configurations.
- Added `_detect_language`, `_lang_matches`, and supporting helpers for robust language validation.
- Updated dependencies to include `fast-langdetect` and `fasttext`.
- Refactored unit tests to cover language validation and detection scenarios.
- Moved `transformers` import into `_pipeline_for` to optimize CLI initialization time.
- Added `TYPE_CHECKING` for conditional imports, ensuring type hints remain intact.
- Refined post-editing constraints to improve clarity and enforcement, adding placeholder-specific rules and glossary handling.
- Adjusted trimming logic for input budget, reducing max_chars allocation to 40%.
- Updated the post-editing prompt format with streamlined sections for constraints, glossary, and self-checks.
@fmueller fmueller merged commit 631c344 into main Dec 17, 2025
2 checks passed
@fmueller fmueller deleted the feat/add-translation-pipeline branch December 18, 2025 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant