feat: add a base version of the translation pipeline#2
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.