Skip to content

fix: Make TranslateSuite resilient to API translation changes - #2491

Merged
Brendan Walsh (BrendanWalsh) merged 1 commit into
masterfrom
brwals/fix-translate-test
Feb 6, 2026
Merged

fix: Make TranslateSuite resilient to API translation changes#2491
Brendan Walsh (BrendanWalsh) merged 1 commit into
masterfrom
brwals/fix-translate-test

Conversation

@BrendanWalsh

@BrendanWalsh Brendan Walsh (BrendanWalsh) commented Feb 6, 2026

Copy link
Copy Markdown
Collaborator

Problem

The TranslateSuite tests assert specific translated strings (e.g. "Wiedersehen", "Au revoir", "再见") from the Azure Translator API. When the API model updates and picks a different valid synonym (e.g. "Tschüss" instead of "Wiedersehen"), tests break. This has already required whack-a-mole fixes (adding || "拜拜"\ , || "早安").

Fix

Replace ambiguous greetings with "elephant" — a concrete noun with stable, unambiguous translations across languages (大象, Elefant, éléphant). Use round-trip translation (en→foreign→en) to verify correctness without asserting specific foreign strings.

Tests changed

Test Before After
Translate multiple pieces of text "Good morning"/"Bye" → assert specific Chinese chars "elephant"/"volcano" → round-trip to English
Translate with transliteration "Bye" → assert 再见/zàijiàn "elephant" → assert 大象/dàxiàng
Translate to multiple languages "Bye" → assert 再见 + Wiedersehen||Tschüss "elephant" → round-trip both zh/de back to English
Obtain alignment "Bye"→fr, assert Au revoir "elephant"→fr, assert contains léphant
Obtain sentence boundaries "Bye"→fr, assert sentLen 3/9 "elephant"→fr, assert sentLen 8/8

Why "elephant"?

Tested against the Azure Translator API across 5 languages — it has exactly one translation per language and round-trips perfectly back to English. Unlike greetings, there are no valid synonyms.

@github-actions

github-actions Bot commented Feb 6, 2026

Copy link
Copy Markdown

Hey Brendan Walsh (@BrendanWalsh) 👋!
Thank you so much for contributing to our repository 🙌.
Someone from SynapseML Team will be reviewing this pull request soon.

We use semantic commit messages to streamline the release process.
Before your pull request can be merged, you should make sure your first commit and PR title start with a semantic prefix.
This helps us to create release messages and credit you for your hard work!

Examples of commit messages with semantic prefixes:

  • fix: Fix LightGBM crashes with empty partitions
  • feat: Make HTTP on Spark back-offs configurable
  • docs: Update Spark Serving usage
  • build: Add codecov support
  • perf: improve LightGBM memory usage
  • refactor: make python code generation rely on classes
  • style: Remove nulls from CNTKModel
  • test: Add test coverage for CNTKModel

To test your commit locally, please follow our guild on building from source.
Check out the developer guide for additional guidance on testing your change.

@BrendanWalsh
Brendan Walsh (BrendanWalsh) force-pushed the brwals/fix-translate-test branch 2 times, most recently from 586d2fd to 413e4cd Compare February 6, 2026 04:16
@BrendanWalsh Brendan Walsh (BrendanWalsh) changed the title fix: Accept alternate German translation in TranslateSuite fix: Make TranslateSuite resilient to API translation changes Feb 6, 2026
Replace ambiguous greetings ('Bye', 'Good morning') with the concrete
noun 'elephant' which has stable, unambiguous translations across
languages (大象, Elefant, éléphant).

Changes:
- 'Translate to multiple languages': uses round-trip assertion
  (en→zh/de→en) instead of asserting specific foreign strings
- 'Translate multiple pieces of text': uses 'elephant'/'volcano'
  with round-trip verification
- 'Translate with transliteration': asserts '大象'/'dàxiàng'
- 'Obtain alignment/sentence boundaries': uses 'elephant'→fr
  ('éléphant', 8 chars) instead of 'Bye'→'Au revoir' (9 chars)

This avoids whack-a-mole fixes every time the translation API model
shifts between valid synonyms (e.g. Wiedersehen vs Tschüss).
@BrendanWalsh
Brendan Walsh (BrendanWalsh) merged commit b11dbef into master Feb 6, 2026
68 checks passed
@BrendanWalsh
Brendan Walsh (BrendanWalsh) deleted the brwals/fix-translate-test branch February 6, 2026 11:20
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