DeepL plugin usage in C# programs

Hi,

in my company, we use SDL Trados Studio 2017 SR1 (Version 14.1.10011.20356)  in combination with the DeepL plugin. With the version 3.0 of this plugin, not all segments were translated. Version 1.9 seems to work in SDL Studio. But, I was unable to use it for a pretranslate task in C#, what was still possible with version 3.0 and the described errors like in SDL Trados Studio: 

 

FileBasedProject fileP = new FileBasedProject(@"path and file name of the project");
ISettingsBundle settings = fileP.GetSettings();

#region pretranslate settings

ISettingsBundle settings = fileP.GetSettings();
TranslateTaskSettings preTranslateSettings = settings.GetSettingsGroup<TranslateTaskSettings>();
preTranslateSettings.ConfirmAfterApplyingExactMatch.Value = true;
preTranslateSettings.ConfirmAfterApplyingInContextExactMatch.Value = true;
preTranslateSettings.CreateReport.Value = true;
preTranslateSettings.LockContextMatchSegments.Value = false;
preTranslateSettings.LockExactMatchSegments.Value = false;
preTranslateSettings.MinimumMatchScore.Value = 100;
preTranslateSettings.NoTranslationMemoryMatchFoundAction.Value = NoTranslationMemoryMatchFoundAction.ApplyAutomatedTranslation;
preTranslateSettings.OverwritePerfectMatch.Value = true;
preTranslateSettings.TranslationOverwriteMode.Value = TranslationUpdateMode.OverwriteExistingTranslation;

fileP.UpdateSettings(fileP.GetTargetLanguageFiles()[0].Language, settings);

#endregion

 

var originalUri = new Uri("deepltranslationprovider:///");

TranslationProviderConfiguration config = fileP.GetTranslationProviderConfiguration();
TranslationProviderCascadeEntry tpce = new TranslationProviderCascadeEntry
            (
                  new TranslationProviderReference(originalUri), false, true, true, 0
            );

config.Entries.Add(tpce);
fileP.Credentials.AddCredential(originalUri, "api key");
fileP.UpdateTranslationProviderConfiguration(config);

 //pretranslate only the file with index 2 

AutomaticTask analyzeTask = fileP.RunAutomaticTask(
                new Guid[] { fileP.GetTargetLanguageFiles()[2].Id },
                AutomaticTaskTemplateIds.PreTranslateFiles);

The segments of the target sdlxliff file were unfortunately not filled. They were only stored as "draft". Please help me that my program is working.

Another problem are large files. I tested with an 1 MB file. In both versions 1.9 and 3.0 they need a lot of time to be processed. It would be nice if the plugin could be modified to work faster.  

 

Many regards,
Andreas Meisel

Parents
  • Unknown said:
    With the version 3.0 of this plugin, not all segments were translated.
    ...
    The segments of the target sdlxliff file were unfortunately not filled. They were only stored as "draft".

    So was it only some (i.e. "not all") or actually all of them?

    Unknown said:
    Please help me that my program is working.

    If you then open the created project in Studio and apply pretranslate task, does it work or not?
    That would give you a clue whether there is something wrong with running the task itself, or with some settings.

    Unknown said:
    I tested with an 1 MB file. In both versions 1.9 and 3.0 they need a lot of time to be processed.

    Please be more specific - what exactly is "lot of time" and why do you think it's too much?
    As Paul mentioned, do you realize how the cloud MT providers work (i.e. that Studio sends every segment separately up to the cloud via Internet and has to wait for each individual response, again received over Internet) and that such process by its nature cannot be made faster (plus, it's heavily influenced by each individual user's Internet connectivity)?

  • In Trados Studio and in my program, some segments were not translated with version 3.0. With version 1.9, all segments were translated in Trados Studio, but my program doesn't do it. I couldn't figure out why. The internet connectivity isn't the issue. I had to wait for an 1MB file around 3-4 minutes. The segments should somehow be bundled to reduce the number of server calls or the server calls should be parallelized. Parallel server access is possible.

  • Unknown said:
    The internet connectivity isn't the issue. I had to wait for an 1MB file around 3-4 minutes.

    "1 MB file" says nothing about the actual number of segments (which is the only relevant measure in this context, as opposed to physical size).
    One can have 1 MB Word file with only "Hello World" text in it (and a huge picture which would take the 1 MB)... or with several tens of thousands words (1 MB of zipped plaintext is a LOT of text!)

    And Internet connectivity still IS a significant aspect since the overall speed of REST API is uncomparable to local TM database access speed, even over a broadband connection.

    Parallel access may be a solution if supported by the particular MT provider (it's not common, IMO).
    But then the entire internal architecture of the Studio translation provider component would probably need to be redesigned... which is unlikely to happen in the near future.Alternatively, you are free to try to write your own "translation provider wrapper" which would support such mode.

  • The number of segments of the large sdlxliff file with around 1MB is 729. The size of the word file alone is only 46kB. I wasn't specific enough. The internet connectivity of my company is no issue. What do you think about bundled data in a single server call? This would be sequential and DeepL supports XML structures. But, it seems to be it also would be my job to implement. Thanks for your informations!

  • 729 segments in 240 seconds (4 mins) is approx. 3 segments per second... that's not that bad, IMO.
Reply Children
No Data