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
  •  

    Another important point  just noted is that it also won't work doing this via the Project Wizard.  This is because the bilingual files don't exist until the project has been created.  So you always need to run this custom task after the project has been created.  So perhaps this was your problem?

    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
  • Hi Paul, thank you very much. Of course I was doing a couple of things wrong :-) I could not find any instruction, I just saw once Daniel in a webinar and did not look attentively to the settings:

    1st: I activated AI Professional in the Projects settings, because I thought that the batch task needed some settings in order to do the job, and as there are no settings for the batch task itself (like there are on the simple Pretranslate File task). What you showed, is that the task is using AI Professional settings as translation provider even if it is not activated (but it needs to be there and deativated, if I understood it right). Good

    2nd For the pretranslate task I have normally 70%, but I did not change it in the AI Professiona settings, so there was another "error" I had in the settings.

    I have a professional version, therefore I can customize batch tasks.

    I will try it now wiht your very useful explanations and let you know if it worked.

    Thank you and have a nice weekend

    Angelo

    emoji
  • I do not use the Project Wizard, as our projects are created via API by Plunet/GroupShare..

    emoji
  • Hi Paul, I just realized there is a little bug in the plugin (I think). If I change a prompt in the Project settings it is not saved (in the AI Professional Companion the change is not visible). If I change a prompt in the Companion, the change is carried on also in the overall settings of AI Professional (as a translation provider): I did a short video:

    Kind rergads

    Angelo

    emoji
  • Update: today the terminology recognition is very bad with the AI Professional Companion, even when I use the same prompts and the same setting. Strange.

    Regards,

    Angelo

    emoji
  • Hi Paul, I just got in touch with Angelo at Elevate and thought of jumping in on the discussion. After several trials, as you said in the video, I was able to make it work. However, to translate 3 documents (of around 800 words each) and asking the API do it at least twice, because it never worked on first try, my API spend bounced at 5$. But it kept the formatting and applied the termbase correctly, which, I think, is a huge deal. Slight smile

    emoji
  • Hi , how did you make it work? I am trying all the time. I do not get any errors anymore, and the second task runs (because I can see the progress) but does not change a thing. Did you restarted only the second task after the one failed? Because I tried to run the task separately and it did not work. Are you using a file based or a server based TB? I am using a server based TM. I will try today once more with a file based TB extracted from the server based TB.

      , if the file is pretranslated (first task alone) and you perform the second task (Pretranslate with AI Professional) alone, is it (should it be) the same as running the two batches together?

    Thank and kind regards,

    Angelo

    emoji
    1. I first transform the document in sdlxliff
    2. I copy the file to the target language
    3. I use the batch Pre-translate function. At first try... it always leaves the target column empty
    4. Then you re-use the batch pre-translate function, and.. it works!

    Trados Studio interface showing a document in sdlxliff format with source and target language columns. The target column is empty despite using the Pre-translate function.

    Here the setting I used:

    Trados Studio settings dialog showing connections to gpt-4 with selected options for search and translation results.

    I use a file based TM. I can't make it work if I do not convert and copy the file to target separately. I think it is too much to handle all at once, that is why it aborts.

    Still, it sends the request twice to the API, so it is double cost, so 0.03 €/word, which is almost the cost of MTPE, so it is not very convenient.
    I'm wondering why you do not allow gpt-4 turbo engine in the list of engines available, it is much less expensive than gpt-4.

    I must say, however, that quality is really awful in Trados, here what I got with gpt-4-1106 preview, for the same sentences:

    Agenzia di SEO in Spagna: l'esperto in posizionamento SEO
    Affida la strategia di posizionamento SEO a un'agenzia di SEO in Spagna e incrementa notevolmente la visibilità sul Web.

    Regards,

    Silvia

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 9:47 AM (GMT 0) on 21 Mar 2024]
  • 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]