Multilingual Capability
Overview
To successfully enable multilingual capabilities we leveraged an LLM via watsonx.ai. The translation process consisted of four steps:
- User selects desired language: "English" or "Spanish"
- If language is "Spanish", the user's query is translated to english.
- Translated query is leverage for Document Search on english data corpus.
- Answer from Document Search is translated back to spanish source language and surface to end user.
How to Implement
note
Prerequisite Required: Document Search
Modify watsonx Assistant actions:
- Create assistant variable to store selected language by end user.
- Within the "Invoke watsonx generation API" which is configured here, create a watsonx.ai prompts for step 2 above.
- Take translated output from watsonx.ai and pass as the context to carry out the Document search with watson discovery.
- Within the "Invoke watsonx generation API" which is configured here, create a watsonx.ai prompts for step 4 above.