Connection via the API key
The powerful ChatGPT natural language models can be integrated seamlessly into CafeTran workflow. Its linguistic abilities prove very useful offering the whole range of functions such as translation, reviewing, rephrasing, explaining the meaning of terms, listing terms based on various criteria, showing variants of terms etc.
The first step is to register at OpenAI website and receive the API key which lets you connect CafeTran to ChatGPT services powered by OpenAI. Please get familiar with OpenAI pricing and the usage based on tokens (chunks of text) at your account there. For example, the popular gpt-3.5-turbo model costs $0.002 for 1000 tokens (about 750 words). Currently, they offer $5 of free usage to test the natural language models.
Once you receive the API key, follow the simple steps to connect CafeTran with ChatGPT API:
- Choose the Dashboard (or Edit) menu > Preferences > Web services tab.
- Tick the ChatGPT powered by OpenAI checkbox and press the API button.
- Paste the API key in the first field and press OK.
After setting the API key, CafeTran opens its CT-L1 Linguist interface connected to ChatGPT API.
CT-L1 Linguist
CafeTran offers the simple and highly-customisable CT-L1 Linguist with the text-based chat editor and the following function buttons:
- Translate - it translates the current source language segment or selection.
- Check - it checks for errors in the current target language segment or selection.
- Rephrase - it rephrases the current target segment or selection.
- Explain - it explains the meaning of the selected phrase in the source or target segment.
- Variants - it shows the variants of the selected term or phrase.
- Shorten - it shortens the translation that may be too long.
- List - it lists the nouns in the current source segment, by default.
- Transfer - it transfers the ChatGPT response to the target language editor.
- New chat - it clears the chat panel and starts a new chat.
- Options - it opens the Options panel.
In addition, you can type your own messages or commands in the last line of the chat editor. Such user's prompts are bolded. The predefined messages in the corresponding buttons can be easily adjusted or changed to your own preferences in the Options panel.
Working with CT-L1 Linguist
The messages are triggered via the buttons manually or automatically. The automatic message action is set on each next segment or selection. This behaviour can be changed via the Action box in the Options panel. You can select the default automatic action in the Default box.
The Translate message can make use of your glossary - its matched terms for the current segment. The glossary can be chosen via the Glossary box in the Options panel. If you wish to transfer the ChatGPT translation to the target segment editor automatically, select the Automatic transfer to the target segment box in the Options panel.
If you activate Amazon Polly text to speech API in CafeTran, ChatGPT responses can be spoken out loud. This option appears only if you turn on Amazon Polly web service in CafeTran Preferences > Web services tab.
Context
The context of the message helps to assist the AI algorithms in providing the correct answer in a given field of specialisation. By default, CT-L1 sends the messages in the linguistics context which can be adjusted to your preferences in the Assistant field of the Options panel.
It is also possible to provide the context dynamically by setting it through a selection in the source/target segment editors or in the chat response. You can see such a selected context in the Search field.
For the selected phrases in the segment, the context of the message sent to the AI can be the whole source or target segment. You can also copy the context from another application or a web browser. Then, CafeTran intercepts the copied content from the system clipboard and set it as the context of the message.
The user can determine which context to use in the Context field of the Options panel. There are six options:
- Assistant message - set in the Assistant field.
- Selection - dynamic setting of the context by selection.
- Chat response - the whole previous response of the ChatGPT is taken into context. It gives the chatting the natural flow and it is applied only when you use the chat editor for sending message.
- Source segment - the current source segment is set as the context of the message.
- Target segment - the current target segment is set as the context of the message.
- Clipboard - the text copied to the system clipboard is the context of the message.
Please bear in mind that the context counts as tokens so it is more frugal to use the short Assistant message or Selection for the context instead of some longer texts. You can see the total number of tokens used in one CafeTran session in the Options panel.
Selection recording
To reduce the number of AI queries for selected phrases, CafeTran offers the build-in selection recording feature. It remembers your selections and then sends them all in one batch to AI for translation or explanation.
You can activate selection recording via the Edit > Selection recording menu (F5 shortcut). The button with the mouse icon will appear in the source segment toolbar. Next, just keep selecting your phrases and click the mouse button after each selection to record it. You can skip the button clicking if you choose "Automatic selection recording" in the mouse button options.
After a certain number of selections, click the mouse button and choose Translate in the button options. All the selected phrases will be sent to AI for the specified prompt (translation, explanation etc.). Alternatively, you can trigger the Translate prompt if you click the mouse button while holding the Shift key.
The mouse button options appear when there is no selection.