Prompting

From Lingoport Wiki
Jump to: navigation, search

Introduction

Some translation connections can take advantage of LLM style prompting. Lingoport provides the ability to pass prompting Localyzer to either TMS with LLM as part of their workflow, or directly to an LLM.

Translation Connection Level

Prompting can be passed to

  • a TMS - e.g. Trados Enterprise - using PXML
  • an LLM connection - e.g. ChatGPT

The Translation Connection Level prompt is set here:

ConnectionPrompt.png

Note: The variables ${SOURCE_LOCALE} and ${TARGET_LOCALE} must be part of the prompt.

Project Level Prompting

For projects on-boarded with a TMS/PXML or an LLM, the advanced settings allows for additional prompting at the project level, for all strings in that project:

ProjectPrompt.png

Context Prompting

If the translation connection is configured with an InContext server, then when a context has been associated with a string (See String Manager / Context), the context will be passed in order to provide the necessary information to better translate that string.

More Details

The prompt that is passed to an TMS or an LLM translation connection is a combination of:

  • The Translation Connection Level prompt. For example:
 As a professional translator, translate an application user interface text from ${SOURCE_LOCALE} to ${TARGET_LOCALE}. Special considerations for UI: Brevity is crucial, Clarity over creativity, Consistency with UI patterns, Action-oriented language. Return only the translated text-no explanation.
  • The Project Level Prompt: For example:
 The application is Globalyzer and Localyzer, as described here https://lingoport.com/software-localization-tools/localyzer-l10n/
  • If InContext Server has a string associated image, that image for that string: For example:
 https://poc.lingoport.io/incontext-server/lookup?token=8JZGug2O004Q6q9Z00ruO5g04Lr8w7SD&key=11405_82
  • The text to translation: For example: Strings

The resulting prompt without an image:

 As a professional translator, translate an application user interface text from English to Latin. Special considerations for UI: Brevity is crucial, Clarity over creativity, Consistency with UI patterns, Action-oriented language. Return only the translated text-no explanation. The application is Globalyzer and Localyzer, as described here https://lingoport.com/software-localization-tools/localyzer-l10n/. Now translate the following: Strings

If an image is associated, the prompt will include:

 As a professional translator, translate an application user interface text from English to Latin. Special considerations for UI: Brevity is crucial, Clarity over creativity, Consistency with UI patterns, Action-oriented language. Return only the translated text-no explanation. The application is Globalyzer and Localyzer, as described here https://lingoport.com/software-localization-tools/localyzer-l10n/. Use the image only if it is relevant to understanding the text (e.g., location, image, signs, or symbols). If the image does not correspond to the text, ignore it. Now translate the following: Strings

Sample PXML

The PXML section will look like:


<?xml version="1.0" encoding="utf-8"?>
<pxml>
 <!-- system_prompt is a concatenation of the translation connection system prompt and the project prompt in Localyzer -->
  <system_prompt><![CDATA[ As a professional translator, translate an application user interface text from English to Latin. Special considerations for UI: Brevity is crucial, Clarity over creativity, Consistency with UI patterns, Action-oriented language. Return only the translated text-no explanation. The application is Globalyzer and Localyzer described here https://lingoport.com/software-localization-tools/localyzer-l10n/.  ]]></system_prompt>
 <resources>
  <string translate="1" segmentID="2" minLength="" maxLength="10">
    <lrm_incontext>https://poc.lingoport.io/incontext-server/lookup?key=11405_82&amp;token=8JZGug2O004Q6q9Z00ruO5g04Lr8w7SD</lrm_incontext>
    <llm_prompt>Now translate the following: Strings </llm_prompt>
    <SID>KEY_17</SID>
    <value>Strings/value>
  </string>
</resources>
</pxml>