AI terminology lookup fails for edited segments (duplicate "target" field)

XMLWordPrintable

    • High
    • None
    • Fix problem where terminology was ignored when requesting translations and TQE.
    • None

      Problem

      When an AI language resource (OpenAI, Azure OpenAI, translate5 AI) translates or evaluates a segment, translate5 collects the terminology of that segment and adds it to the prompt. To find the terms, the segment is sent to the TermTagger first.

      This term lookup can fail for segments that a translator has edited. A segment stores the imported target and the edited target separately. After an import, and also after a pre-translation, both hold the same value. As soon as somebody changes the translation in the editor, only the edited target changes and the two values differ.

      The term lookup prepares the segment the same way as the term tagging during import. In that mode translate5 creates one entry for the imported target and one for the edited target when they differ, and gives both the same field name "target". The TermTagger request expects unique field names per segment and refuses such a segment.

      When this happens, the lookup logs a line like the terms could not be evaluated: Duplicate field "target" and the request is sent to the AI without terminology. No error is shown to the user, so the missing terminology may go unnoticed. Segments that were not edited are not affected.

      In such cases the following requests are sent without terminology:

      • TQE (translation quality estimation) for edited segments.
      • The AI match in the editor when a translator opens an already edited segment.
      • Pre-translation of an existing task without batch mode, for edited segments.

      Not affected: pre-translation during import and batch pre-translation, because those only send segments with an empty target, and InstantTranslate, which does not use segments.

      A second effect of the same lookup: it sends the target fields to the TermTagger as well and collects term entries found in the target. A term entry whose target term appears in the translation can then be handed to the AI as terminology of the source, even when the source term is not in the segment.

      Solution

      • The terminology lookup for AI resources sends only the source of the segment to the TermTagger. The target is not needed to find the source terms, so no duplicate field can occur and no term entries are collected from the target.
      • The regular term tagging during import and in the editor stays unchanged.
      • Verify with a task that has a term collection and an AI resource: edit a segment, then run a TQE and open the segment in the editor. The log must stay clean and the AI request must contain the terminology of the source.

            Assignee:
            Aleksandar Mitrev
            Reporter:
            Aleksandar Mitrev
            None
            None
            Sanya Mikhliaiev
            NO-FRONTEND-TESTING NEEDED
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None