Error with batch task Pretranslate with AI Professional

Hi

I created a batch task with "Pretranslate files" followed by "Pretranslate files with AI Professional", where the prompt is "Refine translation" in order to update the translation provided by ModernMT wiht terminlogy present in Multiterm.

It does not work (it worked only ones after installing the new update of the plugin but then it kept on gettin an error). Mostly I get the error during the task "Pretranslate files", sometimes the first task is successful and I get the error for the task "Pretranslate with AI Professional". Error attached.

I tried to do it separately, I do not get errors, but the second task Pretranslate with AI Professional does not change anything.

Kind regards,

Angelo

<SDLErrorDetails time="20.02.2024 17:28:34">
  <ErrorMessage>Unexpected exception when configuring file multiFileConverter for task 'Pre-translate Files with AI Professional': The constructor to deserialize an object of type 'Sdl.Terminology.TerminologyProvider.Core.Exceptions.InvalidCredentialsException' was not found..</ErrorMessage>
  <Exception>
    <Type>Sdl.ProjectApi.ProjectApiException, Sdl.ProjectApi, Version=17.0.0.0, Culture=neutral, PublicKeyToken=c28cdb26c445c888</Type>
    <HelpLink />
    <Source>Sdl.ProjectApi.Implementation</Source>
    <HResult>-2146233088</HResult>
    <StackTrace><![CDATA[   at Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.TaskFileExecuter.ConfigureConverter(IMultiFileConverter multiFileConverter, Language targetLanguage)
   at Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.TaskFileExecuter.CreateMultiFileConverter(IProjectFile tf, String filePath)
   at Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.TaskFileExecuter.Parse(String targetFilePath)]]></StackTrace>
    <InnerException>
      <Type>System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>
      <HelpLink />
      <Source>Sdl.ProjectAutomation.FileBased</Source>
      <HResult>-2146233088</HResult>
      <StackTrace><![CDATA[   at Sdl.ProjectAutomation.FileBased.FileBasedProject.RunAutomaticTask(Guid[] projectFileIds, String taskTemplateId)
   at AIProfessional.BatchTasks.AIProfessionalPreTranslateFiles_Id.ConfigureConverter(ProjectFile projectFile, IMultiFileConverter multiFileConverter)
   at Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementationAdapter.ConfigureConverter(IExecutingTaskFile executingTaskFile, IMultiFileConverter multiFileConverter)
   at Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.TaskFileExecuter.ConfigureConverter(IMultiFileConverter multiFileConverter, Language targetLanguage)]]></StackTrace>
      <InnerException>
        <Type>System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>
        <HelpLink />
        <Source>Sdl.ProjectAutomation.FileBased</Source>
        <HResult>-2146233088</HResult>
        <StackTrace><![CDATA[   at Sdl.ProjectAutomation.FileBased.FileBasedProject.RunAutomaticTask(Guid[] projectFileIds, String taskTemplateId, EventHandler`1 statusEventHandler, EventHandler`1 messageEventHandler)
   at Sdl.ProjectAutomation.FileBased.FileBasedProject.RunAutomaticTask(Guid[] projectFileIds, String taskTemplateId)]]></StackTrace>
        <InnerException>
          <Type>System.Runtime.Serialization.SerializationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>
          <HelpLink />
          <Source>mscorlib</Source>
          <HResult>-2146233076</HResult>
          <StackTrace><![CDATA[   at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
   at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
   at System.Runtime.Serialization.ObjectManager.DoFixups()
   at System.Runtime.Serialization.Formatters.Soap.ObjectReader.Deserialize(HeaderHandler handler, ISerParser serParser)
   at System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize(Stream serializationStream, HeaderHandler handler)
   at Sdl.ProjectApi.Implementation.Util.DeserializeException(String s)
   at Sdl.ProjectApi.Implementation.Xml.ExecutionMessage.get_Exception()
   at Sdl.ProjectApi.Implementation.ExecutionMessage.get_Exception()
   at Sdl.ProjectAutomation.FileBased.Converters.ExecutionMessageConverter.CreateExecutionMessage(IExecutionMessage m)
   at Sdl.ProjectAutomation.FileBased.AutomaticTasksProcessor.<>c__DisplayClass11_0.<ConvertMessages>b__1(IExecutionMessage m)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Sdl.ProjectAutomation.FileBased.AutomaticTasksProcessor.ConvertMessages(IAutomaticTask projectApiAutomaticTask)
   at Sdl.ProjectAutomation.FileBased.AutomaticTasksProcessor.CreateAutomaticTaskObject(IAutomaticTask projectApiAutomaticTask)
   at Sdl.ProjectAutomation.FileBased.AutomaticTasksProcessor.RunAutomaticTask(IEnumerable`1 projectFileIds, String taskTemplateId, EventHandler`1 statusEventHandler, EventHandler`1 messageEventHandler)
   at Sdl.ProjectAutomation.FileBased.FileBasedProject.RunAutomaticTask(Guid[] projectFileIds, String taskTemplateId, EventHandler`1 statusEventHandler, EventHandler`1 messageEventHandler)]]></StackTrace>
          <InnerException>
            <Type>System.Runtime.Serialization.SerializationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>
            <HelpLink />
            <Source>mscorlib</Source>
            <HResult>-2146233076</HResult>
            <StackTrace><![CDATA[   at System.Runtime.Serialization.ObjectManager.GetConstructor(RuntimeType t)
   at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)]]></StackTrace>
          </InnerException>
        </InnerException>
      </InnerException>
    </InnerException>
  </Exception>
  <Environment>
    <ProductName>Trados Studio</ProductName>
    <ProductVersion>Studio17</ProductVersion>
    <EntryAssemblyFileVersion>17.2.9.18688</EntryAssemblyFileVersion>
    <OperatingSystem>Microsoft Windows 11 Pro</OperatingSystem>
    <ServicePack>NULL</ServicePack>
    <OperatingSystemLanguage>1040</OperatingSystemLanguage>
    <CodePage>1252</CodePage>
    <LoggedOnUser>Office2022Win11\angelo.caltagirone</LoggedOnUser>
    <DotNetFrameWork>4.0.30319.42000</DotNetFrameWork>
    <ComputerName>OFFICE2022WIN11</ComputerName>
    <ConnectedToNetwork>True</ConnectedToNetwork>
    <PhysicalMemory>33257044 MB</PhysicalMemory>
  </Environment>
</SDLErrorDetails>

emoji
Parents
  • HI, another error message, this time with the first pretransalte task:

    <SDLErrorDetails time="21.02.2024 10:58:30">
      <ErrorMessage>One or more errors occurred.</ErrorMessage>
      <Exception>
        <Type>System.AggregateException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>
        <HelpLink />
        <Source>mscorlib</Source>
        <HResult>-2146233088</HResult>
        <StackTrace><![CDATA[   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
       at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
       at System.Threading.Tasks.Task`1.get_Result()
       at AIProfessional.Providers.TranslationProvider.AITranslationProviderLanguageDirection.SearchTranslationUnitsMasked(SearchSettings settings, TranslationUnit[] translationUnits, Boolean[] mask)
       at Sdl.LanguagePlatform.TranslationMemoryApi.Cascade`1.SearchTranslationUnitsMaskedCommand.Execute(T cascadeEntry, SearchSettings searchSettings)
       at Sdl.LanguagePlatform.TranslationMemoryApi.Cascade`1.ExecuteSearchCommand(SearchCommand`1 searchCommand, SearchSettings searchSettings, Int32 searchResultsCount, IEnumerable`1& cascadeMessages)]]></StackTrace>
        <InnerException>
          <Type>System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>
          <HelpLink />
          <Source>AIProfessional</Source>
          <HResult>-2147467261</HResult>
          <StackTrace><![CDATA[   at AIProfessional.Providers.TranslationProvider.AITranslationProviderLanguageDirection.<GetSearchResults>d__34.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
       at AIProfessional.Providers.TranslationProvider.AITranslationProviderLanguageDirection.<ProcessTasks>d__33.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
       at AIProfessional.Providers.TranslationProvider.AITranslationProviderLanguageDirection.<>c__DisplayClass32_0.<<SearchTranslationUnitsMasked>b__0>d.MoveNext()]]></StackTrace>
        </InnerException>
      </Exception>
      <Environment>
        <ProductName>Trados Studio</ProductName>
        <ProductVersion>Studio17</ProductVersion>
        <EntryAssemblyFileVersion>17.2.9.18688</EntryAssemblyFileVersion>
        <OperatingSystem>Microsoft Windows 11 Pro</OperatingSystem>
        <ServicePack>NULL</ServicePack>
        <OperatingSystemLanguage>1040</OperatingSystemLanguage>
        <CodePage>1252</CodePage>
        <LoggedOnUser>Laptop2022Win11\angelo.caltagirone</LoggedOnUser>
        <DotNetFrameWork>4.0.30319.42000</DotNetFrameWork>
        <ComputerName>LAPTOP2022WIN11</ComputerName>
        <ConnectedToNetwork>True</ConnectedToNetwork>
        <PhysicalMemory>33258180 MB</PhysicalMemory>
      </Environment>
    </SDLErrorDetails>

    Trados Studio Batch Processing Finish screen showing an error message for Pre-translate Files task with 1 message reported and 1 error.

    If I repeat pre-translate files alone I do not get any error message.

    EDIT: no, even now when I run the batch task alone I get the same error message, strange, normally ti works.

    Regards, Angelo



    Generated Image Alt-Text
    [edited by: Trados AI at 1:43 PM (GMT 0) on 29 Feb 2024]
  • Further Update: I got the errors when I run the batch tasks with two files. I run it on one file (I have still to check, if Pretranslate with AI Professional made any changes on the translations done by the ModernMT plugin) and it worked without any errors. Then I run the batch task on the second file and I got this error on the first task:

    <SDLErrorDetails time="21.02.2024 11:21:30">
      <ErrorMessage>One or more errors occurred.</ErrorMessage>
      <Exception>
        <Type>System.AggregateException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>
        <HelpLink />
        <Source>mscorlib</Source>
        <HResult>-2146233088</HResult>
        <StackTrace><![CDATA[   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
       at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
       at System.Threading.Tasks.Task`1.get_Result()
       at AIProfessional.Providers.TranslationProvider.AITranslationProviderLanguageDirection.SearchTranslationUnitsMasked(SearchSettings settings, TranslationUnit[] translationUnits, Boolean[] mask)
       at Sdl.LanguagePlatform.TranslationMemoryApi.Cascade`1.SearchTranslationUnitsMaskedCommand.Execute(T cascadeEntry, SearchSettings searchSettings)
       at Sdl.LanguagePlatform.TranslationMemoryApi.Cascade`1.ExecuteSearchCommand(SearchCommand`1 searchCommand, SearchSettings searchSettings, Int32 searchResultsCount, IEnumerable`1& cascadeMessages)]]></StackTrace>
        <InnerException>
          <Type>System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>
          <HelpLink />
          <Source>AIProfessional</Source>
          <HResult>-2147467261</HResult>
          <StackTrace><![CDATA[   at AIProfessional.Providers.TranslationProvider.AITranslationProviderLanguageDirection.<GetSearchResults>d__34.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
       at AIProfessional.Providers.TranslationProvider.AITranslationProviderLanguageDirection.<ProcessTasks>d__33.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
       at AIProfessional.Providers.TranslationProvider.AITranslationProviderLanguageDirection.<>c__DisplayClass32_0.<<SearchTranslationUnitsMasked>b__0>d.MoveNext()]]></StackTrace>
        </InnerException>
      </Exception>
      <Environment>
        <ProductName>Trados Studio</ProductName>
        <ProductVersion>Studio17</ProductVersion>
        <EntryAssemblyFileVersion>17.2.9.18688</EntryAssemblyFileVersion>
        <OperatingSystem>Microsoft Windows 11 Pro</OperatingSystem>
        <ServicePack>NULL</ServicePack>
        <OperatingSystemLanguage>1040</OperatingSystemLanguage>
        <CodePage>1252</CodePage>
        <LoggedOnUser>Laptop2022Win11\angelo.caltagirone</LoggedOnUser>
        <DotNetFrameWork>4.0.30319.42000</DotNetFrameWork>
        <ComputerName>LAPTOP2022WIN11</ComputerName>
        <ConnectedToNetwork>True</ConnectedToNetwork>
        <PhysicalMemory>33258180 MB</PhysicalMemory>
      </Environment>
    </SDLErrorDetails>

    I run the batcht task "Pretranslate files" alone and I got the same error. Then I deactivated AI Professional form the TM provider and I could pretranslate the file.

    emoji
  • Hi  

    Ehm, in order to understand better: you use AI Professional for translation and not for update a text already translated by MT?
    Because I use ModernMT for pretranslation and after the pretranslation I use AI Professional to refine the translation using the terminology in the project (see video of Paul). So it is a different approach.

    Settings:

    Trados Studio Batch Processing window showing custom task sequence with 'Pre-translate Files' and 'Pre-translate Files with AI Professional' selected.

    The first batch task translates the text with ModernMT

    The second refines the translated text on top of it using the terminology attached to the project. These are my settings:

    Settings dialog in Trados Studio with options for AI Professional including 'Enable Terminology-aware Translation Suggestions' and 'Include target segment with the translation request' checked.

    I will try thought to run the task Pretranslate with AI Professional twice to see if there is an improvement.

    Regards,

    Angelo

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 10:21 AM (GMT 0) on 21 Mar 2024]
  • Hi I give up, it makes no sense. I tried everything you mentioned, it is not working, the batch task changes absolutely nothing. I tried with server based AND file based TB, nothing. I tried to run the batch task twice, as mentioned by (but she uses the plugin to translate and not to refine), nothing. I only managed to avoid the errors, maybe because the plugin was activated in the setting and/or the percentage was not identical to the one in the pretranslate settings. AI Professional does the magic, therefore it is not a problem with the connection to OpenAI, so I do not understand because it is not working with the batch task

    It's costing me time and money, because everytime I run a batch task I have to pay OpenAI, even if it retrieves nothing.

    I will stop testing it until somebody can come up with a solution. Unfortunately, being an app problem it is not supported by RWS technical support, therefore I cannot open a ticket about it.

    Let me know, if you come up with other things I can test, maybe Patrick can help.

    Thanks anyway and kind regards,

    Angelo

    emoji
  • Hi Angelo,

    I have been following this thread with great interest, because it is the same case I am testing myself, with similar results. When using AI Companion to refine the translations from the editor, segment by segment, you can see changes - not all of them respect the terminology either, but ok.

    What I haven't been able to achieve is to use AI Companion to refine the existing translation using batch tasks, either the segments translated by an NMT or just the source copied to the target. Same case: nothing changes when doing it with batch tasks.

    I'm keeping an eye on this issue and I hope this interesting and powerful functionality evolves to be more usable.

    Best regards,

    Almudena

    emoji
  •  

    Ehm, in order to understand better: you use AI Professional for translation and not for update a text already translated by MT?

    Correct.

    The first batch task translates the text with ModernMT

    The second refines the translated text on top of it using the terminology attached to the project.

    I see. I do not use ModernMT, GPT usually does the trick for me.

    And I do not see the point in asking for refinement, since it applies correctly the Style Guide (in the prompt) and the Glossary (in the .sdltm file).

    emoji
  • Hi Silvia, a question for you about the prompt, style guide and the glossary: how many lines has your prompt? Are all the guide instructions in the style guide included in the prompt, only a few? How do you get the AI professional to apply the glossary through a translation memory? (you said, sdltm file)

    Thanks in advance,

    Almudena

    emoji
  • Hi Almudena, I am glad to know, that I am not alone having this problem. In Paul's video everything is easy done, so I do not know why it is not working for us.

    Best regards,

    Angelo

    emoji
  • The prompt is quite long (2131 characters). It doesn't actually have lines, because I saw that I can't go at the line no matter what I do, so it is basically written like this:

    Translate the this text in *the style you want* style, using this set of rules: 1. *Rule number one*. 2. *Rule number two*. *(etc.)*… and I got 22 rules, some with examples in it, too.

    If the plugin works correctly, and you have added your glossary to the project, it should use it, if you use the same setting as mine, so, if you ticked "Enable terminology-aware Translation Suggestions". But I have a termbase applied (.sdltb file) and I also converted that termbase with Glossary Converter into a translation memory (.sdltm).

    But, again, at times it works, at times it doesn't. 

    emoji
  • Hello  

    Just like you, I get an error message when trying to update my translation with terms from my glossary using AI Professional.

    Error details from Trados Studio with timestamp and message 'One or more errors have occurred'. Includes system exception details, product name 'Trados Studio', version 'Studio17', and system environment information.

    So I've checked what I would get directly in my file, and it turns out I get suggestions to replace terms with translated terms that are not in my glossary (see below).

    Screenshot of Trados Studio software showing a translation segment with a term recognition error. The term 'FISHING MASTER' is incorrectly suggested to be replaced with 'patron de peche' instead of the correct glossary term.

    But after watching your very instructive video, I got suddenly frightened: I'm a freelancer, so I have a freelance license for Studio. Am I then not able to use this feature in Studio, considering I cannot use Custom batch tasking?

    Could this explain 1/ the error message and 2/ the errors in the suggested terms?

    Please please tell me I misunderstood and simply misused the tool and will be able to benefit this great AI feature

     Thank you!

    emoji


    Generated Image Alt-Text
    [edited by: RWS Community AI at 8:29 AM (GMT 1) on 10 Jun 2024]
  •   

    I tagged  because he has, and still is, going through all kinds of "learnings" about how to work with this tool.  So for a quick answer to your question he probably has it to hand.

    But having said all of this the next release that will come with Trados Studio 2024 is massively improved and far more reliable than the version you have right now.  It may be better to really engage with this plugin when it's released... very soon!

    I'm a freelancer, so I have a freelance license for Studio. Am I then not able to use this feature in Studio, considering I cannot use Custom batch tasking?

    Just to answer this one... there is nothing to be concerned about.  You will be able to use it, but you'll just have to run two separate batch tasks, or one depending on what you're doing.  If you only use AI Professional to update the terminology and not pre-translate then you would not need to specifically enable the AI Professional provider.  Just use the batch task that pre-translates with AI Professional and it will only update your terminology:

    Screenshot showing two menu options: 'Pre-translate Files' and 'Pre-translate Files with AI Professional', with a red arrow pointing to the second option.

    So if you use other MT providers you would pre-translate with those first, and then run this task afterwards.  I don't really know how you're working so it's hard to provide an exhaustive reply.

    So the custom batch task gives you the ability to combine different tasks in one go.  If you have FL as you do, then you just manually run them one after the other.

    But if you still have problems, and it definitely can be tricky to get this right as we had to "bend the rules" in Studio under the hood to be able to achieve this feature in a plugin, then unless you are in a hurry I would wait for 2024 which is easier to work with.

    But perhaps  can share his thoughts on this?

    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

    emoji


    Generated Image Alt-Text
    [edited by: RWS Community AI at 11:15 AM (GMT 1) on 10 Jun 2024]
  • Thank you,  for your speedy reply.

    I still don't understand why it does not use my TB terms when running the 2 tasks (NMT pre-translation then AI refine task) one after the other.

    I've rechecked my settings once more and can't figure out where the issue is.

    We'll see if  has any insights on this.

    I'm really new to all this and I'm eager to learn more!

    emoji
Reply Children
No Data