Penalties in the Translation Provider API

I have a working MT engine plugin developed against the Translation Provider API. It's working in Trados 2017 and Trados 2019. I'm encountering the problem below in Trados 2017 (it may occur in 2019, haven't tried yet).

I would like to apply a penalty to the output of the MT engine. In "Project Settings" -> "Language Pairs" -> "Translation Memory and Automated Translation", I add a penalty setting. However, it's ignored when the engine populates an output segment in the editor view; the score is whatever score is set in the code in the language direction:

            int score = 90;
            tu.Origin = TranslationUnitOrigin.MachineTranslation;


            SearchResult searchResult = new SearchResult(tu);
            searchResult.ScoringResult = new ScoringResult();
            searchResult.ScoringResult.BaseScore = score;

There are two properties in the translation provider that look like they'd be useful:

public bool SupportsPenalties
{
    get { return false; }
}

public bool SupportsScoring

{
    get { return false; }
}

However, changing these values to true makes no difference whatsoever.

What's the proper way to have penalties for MT engines accounted for?

Thanks in advance.

Parents
  • Hello

    I'm a bit confused about your usecase, and I don't think this is going to be possible anyway.  The penalties apply to TM results that are calculated based on the match of the source segment against the TM.  With MT you don't have this at all, you only have an AT status and the ability to set the match value through the code (as you have done) so it can be seen if you hover over the AT or check within the sdlxliff.

    As you are setting the value yourself through code I think this is always going to be the value and it will not be adapted with a penalty.  If you really want to have this ability I think you might have to build this in as a parameter the user can set within the UI for your provider.  But I'm not sure why this would be useful as the use of MT or not is based around the values you have set for TM matching and not MT.  Why would you set a specific value through the code and then adapt it with a penalty?

  • Hi Paul -

    I can't say that there's a plausible use case - I'm the plugin developer, not the user, and the group I'm supporting is not, itself, intimately familiar with the complexities of Trados and its workflow expectations. But I can think of a couple reasons:

    (a) the presence of a penalty setting in the UI that doesn't do anything is kind of mysterious and unfriendly to the user. The SupportsPenalties member in the TranslationProvider class doesn't cause the penalty cell to be disabled if it returns false. (In fact, I can't figure out what it controls, or what SupportsScoring controls. If you know, I'd love to know.) So just for user friendliness, I'd implement it (and, I'd argue, Trados itself should disable the penalty setting if SupportsPenalties returns false, and apply the ProviderPenalty automatically if it returns true).

    (b) it's another way to control the priority of translations.

    Beyond that, I got nothing :-).

Reply
  • Hi Paul -

    I can't say that there's a plausible use case - I'm the plugin developer, not the user, and the group I'm supporting is not, itself, intimately familiar with the complexities of Trados and its workflow expectations. But I can think of a couple reasons:

    (a) the presence of a penalty setting in the UI that doesn't do anything is kind of mysterious and unfriendly to the user. The SupportsPenalties member in the TranslationProvider class doesn't cause the penalty cell to be disabled if it returns false. (In fact, I can't figure out what it controls, or what SupportsScoring controls. If you know, I'd love to know.) So just for user friendliness, I'd implement it (and, I'd argue, Trados itself should disable the penalty setting if SupportsPenalties returns false, and apply the ProviderPenalty automatically if it returns true).

    (b) it's another way to control the priority of translations.

    Beyond that, I got nothing :-).

Children
No Data