Ensuring same language in a response #368
Replies: 3 comments
-
A recent hotfix went into the "main" branch on top of 0.4-Delta release to address this partially. (#346 ) The simple answer is that the accelerator is designed to support a single target language and to translate any users question into that target language. This happens in the prompt engineering both when converting the users question to the "best possible search terms" via AOAI and when generating the system prompt for summarizing the "top N search results". You can see where we do this in the prompts in https://github.com/microsoft/PubSec-Info-Assistant/blob/main/app/backend/approaches/chatreadretrieveread.py. As for multi-lingual support, where the system honors the language in which the question was asked and then responds in that same language, this is more complicated.
|
Beta Was this translation helpful? Give feedback.
-
The target language of our deployment is English. If we upload a document written in Spanish, then submit a query in Spanish, the response is in English. However, when we then select the 'Regenerate' icon, the response is in Spanish. Can you please explain why this happens? Is the indexing for the Spanish document in English (thus the initial English response)? What causes Regenerate to return a response in Spanish? |
Beta Was this translation helpful? Give feedback.
-
@mbarnettHMX , I believe this is now resolved with our latest release v1.1. In this release the code automatically detects the language of the users question and guides the LLM to respond using the same language . |
Beta Was this translation helpful? Give feedback.
-
We understand [how to set the default language]b(https://github.com/microsoft/PubSec-Info-Assistant/blob/main/docs/features/configuring_language_env_files.md); however, it's not clear how to ensure that responses are always in the language used in a prompt. For example, if the current default language is English, but we want to demonstrate queries submitted in Spanish (some of the uploaded documents are in Spanish), sometimes we get a response in Spanish and other times in English. Is there a way to ensure that the response is always in the same language as prompted?
Beta Was this translation helpful? Give feedback.
All reactions