Segments sent to Machine Translation even if there is a match from TM

Hello everybody

I have developed a translation provider (using Studio 2017 API) for our MT engine and almost everything works as expected...

However after running some testes we encountered a small issue: 

- Segments / translation units are sent to our MT provider plugin even if the option "Look up segments in MT even if a TM match has been found" is not ativated?
--> Translation method is set to MT:
public TranslationMethod TranslationMethod
{
get { return TranslationMethod.MachineTranslation; }
}

Are there other settings i am missing in order to make it work?

Screenshot of Studio Developers Q&A settings with a highlighted warning: 'Search for matches even if a TM match has been found'.

- And the second thing is (probably it should be like that) not only the active translation unit is sent for look up but 2 or 3 additional translation units (coming after the active one)?

 

Thanks,

Arben



Generated Image Alt-Text
[edited by: RWS Community AI at 6:13 AM (GMT 0) on 15 Nov 2024]
Parents Reply Children
  • ok - I'll see if can help... she knows this application pretty well :-)

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

  • Hi Arben Sabani (asabani) ,

    Could you please tell me if when receive results from your TM the provider is also called? 

    One more thing the TM order in Studio is important, you need to put your TM first and the provider should be second.

     

     

    Starting from SR1 Studio introduced "Look ahead" feature, this is why 2 or 3 additional translation units are sent for look up. You can enable/ disable this option from here:

     

    Regards,

    Andrea.

  • Hi Andrea-Melinda Ghisa

    Thank you very much for your answer.

    To your questions:

    Could you please tell me if when receive results from your TM the provider is also called?

    - When there is a match in the TM my machine translation provider is called as well.

    - I have attached the SDL Studio process to Visual Studio and check what is sent and when. So whenever I click on a segment in SDL Studio the machine translation provider is called independent if there is a match coming from TM or not. As you can see the break point is hit.

    - So I am getting a match form TM and machine translation provider as you can see above. First match is from TM and second from machine translation provider.

    - Interesting is that the translation unit sent to my machine translation provide does not have a target segment (null). Could it be that Studio is not waiting for the match from TM? Otherwise if Studio would wait, then at least I would expect a translation unit with targetsegment != null? Or? No idea how Studio calls all the attached provides in a project, in sequence (waiting for match from TM) or asych. (all providers in parallel)? I would expect the first option as other wise this setting in Studio wouldn't make sense somehow?

    One more thing the TM order in Studio is important, you need to put your TM first and the provider should be second.

    - TM is first and provider second.

    Starting from SR1 Studio introduced "Look ahead" feature, this is why 2 or 3 additional translation units are sent for look up. You can enable/ disable this option from here:

    - Thanks didn’t know about this option, at least only the active segment is sent now. 

    Best

    Arben

  • Hi Arben Sabani,

    Sorry for not coming back sooner to you.

    I've investigating the issue where the translation provider is called. If you look on MT Enhanced plugin there is a form with the plugin settings:

    You need to handle in your plugin the case where you have a match from TM, and not call the provider.

    Code example from MT Enhanced:

    where: _options.ResendDrafts = the option from the UI, but you can omit this in your verification

    if (!_options.ResendDrafts && inputTu.ConfirmationLevel != ConfirmationLevel.Unspecified) //i.e. if it's status is other than untranslated
    { //don't do the lookup, b/c we don't need to pay google to translate text already translated if we edit a segment
    translation.Add(PluginResources.TranslationLookupDraftNotResentMessage);


    //later get these strings from resource file
    results.Add(CreateSearchResult(segment, translation, segment.ToString()));
    return results;
    }

    If you want to understand exactly how it works you can download the latest version for github I can tell you exactly where you need to put a break point  and see how the provider works.

    In MtTranslationProviderLanguageDirection class,  in SearchSegment method (line 117) put a break point at line 130 there we check if we have match results from TM.

     

    If you have any questions do not hesitate to ask.

    Kind regards,

    Andrea.