Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Glossary Not Working for Certain Terms

Our glossaries are working fairly well, but we have "ampli-energy R AX R D" as part of our Glossary and it's always getting translated to "Verstärkerenergie R AX R D".  Any ideas why? 

Here is the complete API call that we're making:

{"contents":["TEST ampli-energy R AX R D"],"targetLanguageCode":"de","mimeType":"text/plain","sourceLanguageCode":"en","glossaryConfig":{"ignoreCase":"true","glossary":"projects/reviewstudio-190200/locations/us-central1/glossaries/org-00DOx0000067dafMAA-068Ox000003f81VIAQ"}}

and the Response:

{
  "translations": [
    {
      "translatedText": "TEST Verstärkerenergie R AX R D"
    }
  ],
  "glossaryTranslations": [
    {
      "translatedText": "TEST Verstärkerenergie R AX R D",
      "glossaryConfig": {
        "glossary": "projects/65198939862/locations/us-central1/glossaries/org-00DOx0000067dafMAA-068Ox000003f81VIAQ",
        "ignoreCase": true
      }
    }
  ]
}

 

0 1 237
1 REPLY 1

Hi @1440,

Welcome to Google Cloud Community!

You are using Google Cloud Translation API, based on the glossary path provided in your API call:

 

"glossary": "projects/reviewstudio-190200/locations/us-central1/glossaries/org-00DOx0000067dafMAA-068Ox000003f81VIAQ"

 

You can check this documentation for more information on glossary paths. 

Here are the potential issues and solutions related to the Google Cloud Translation API:

  1. Glossary Entry Structure
  • Problem: The translation engine might be treating "ampli-energy" and "R AX R D" as separate words.
  • Solution: Ensure "ampli-energy R AX R D" is entered as a single phrase in your glossary to guarantee accurate translation. Remove any unnecessary spaces within the term.
  1. Case Sensitivity
  • Problem: Despite the ignoreCase setting, the glossary or your code might be case-sensitive.
  • Solution: Verify that the case of the glossary entry matches the term being translated. Test different case variations to isolate the issue.
  1. Glossary Updates
  • Problem: The glossary might not be updated correctly or recent changes haven't been applied to the API.
  • Solution: Check glossary settings in the Google Cloud Console and ensure the term is defined as a phrase. Invalidate the glossary cache if necessary.
  1. API Configuration
  • Problem: Incorrect API configuration might prevent effective glossary usage.
  • Solution: Review the Google Cloud Translation API documentation for proper glossary configuration. You can refer to examples and tutorials for guidance.

To further troubleshoot, isolate the term "ampli-energy R AX R D" by translating it on its own, without any surrounding text. This will help determine if the translation issue is specific to that term or related to its context. Additionally, testing with other known glossary entries can ascertain whether the glossary is functioning as intended. This process can help pinpoint the issue to either the specific term "ampli-energy R AX R D" or a broader problem with the glossary application.

I hope the above information is helpful.