Digital Assistant and Mobile

Get Involved. Join the Conversation.

Topic

    Konstantinos Skouras
    Bot with QnA using TranslationAnswered
    Topic posted May 14, 2019 by Konstantinos SkourasGreen Ribbon: 100+ Points, tagged Bots, Conversational AI, Messaging, Virtual Assistant 
    72 Views, 7 Comments
    Title:
    Bot with QnA using Translation
    Summary:
    Bot with QnA, in language that is not supported to directly upload a QnA file.
    Content:

    Hi,

    I would like to create a bot, that offers QnA in Greek. Currently, Greek is not a supported language for directly uploading a QnA file.

    However, would it be possible to use a Translation service, for offering QnA in Greek?

    The way I am thinking of implementing this is:

    1. QnA file is uploaded in English
    2. User asks the bot a question in Greek
    3. The bot translates the user's question in English i.e. using autoTranslate.
    4. The bot searches through the available QnA file, using the translated text.
    5. If the bot finds a match, presents the QnAs to the user, translated to the user's language using autoTranslate. 

    Could this approach work? I have tried it by experimenting with the default FinancialQnABot, but the Bot doesn't seem to navigate to the qna intent when the user's language is Greek.

    I have also tried it with and without autoTranslate but the results were the same.

    You can find below:

    1. the flow with autoTranslation enabled,
    2. screenshots of some test "Runs" and their relevant JSON files. 
    3. the file with all the QnAs. (Not a video, just a csv file with the QnAs used by default in the FinancialQnABot)

    Note that, in the screenshot of the Greek test Run, you can see at the bottom right, that the translated variable holds the same question, like the one given directly in the English test Run. 

    Please, let me know if this is a valid solution, but I have made a mistake in my implementation, or if there is any other way to create a QnA bot in such a language.

    Version:
    19.1.3-1902192355
    Code Snippet:
    Document:
    Document:
    Document:
    Document:

    Best Comment

    Frank Nimphius

    The problem is that the content returned from QnA is not saved in a component and thus isn't saved back so it can be translated. While you can get a QnA response with the steps below (did not try, but think this should work), it will display the answer in English and not translated into Greek. 

    detect:
        component: "System.DetectLanguage"
        properties: {}
        transitions: {}
      
      translate:
        component: "System.TranslateInput"
        properties:
          variable: "translated"
        transitions: {}

     

    resetLanguage:
        component: "System.SetVariable"
        properties:
          variable: "profile.languageTag"
          value: "en"
        transitions: {}

    intent:
        component: "System.Intent"
        properties:
          variable: "iResult"
          sourceVariable: "translated"
          qnaUseSourceVariable: true
          qnaEnable: true
        transitions:
          actions:
            unresolvedIntent: "unresolved"
            qna: "qna"

     

    Frank

     

    Comment

     

    • Grant Ronald

      We are actually working on support for Greek in our next release (although no promises) it might be that you could wait for that.  The other option is to select a language that is supported (e.g. Italian) but you input your QnA as Greek.  You would then have to manually "flip" the detectedLanguage to Italian when you call the QnA.  There are limitations to doing this (e.g. stop words would be wrong) but it MIGHT be enough for you

    • Frank Nimphius

      The problem is that the content returned from QnA is not saved in a component and thus isn't saved back so it can be translated. While you can get a QnA response with the steps below (did not try, but think this should work), it will display the answer in English and not translated into Greek. 

      detect:
          component: "System.DetectLanguage"
          properties: {}
          transitions: {}
        
        translate:
          component: "System.TranslateInput"
          properties:
            variable: "translated"
          transitions: {}

       

      resetLanguage:
          component: "System.SetVariable"
          properties:
            variable: "profile.languageTag"
            value: "en"
          transitions: {}

      intent:
          component: "System.Intent"
          properties:
            variable: "iResult"
            sourceVariable: "translated"
            qnaUseSourceVariable: true
            qnaEnable: true
          transitions:
            actions:
              unresolvedIntent: "unresolved"
              qna: "qna"

       

      Frank

       

    • Konstantinos Skouras

      One more Question related to Greek.

      In the Insights, all conversations in Greek, are displayed as question marks, but the ones in English are displayed normally. Is this a bug of the current version? Or should I configure something?

      *Edit for clarification*, when the bot sees the language tag el, it replies in Greek as expected (apart from the QnA), but in the insights all the greek conversations are displayed as question marks.

    • Grant Ronald

      I need to check the bug database but I do believe this is a know issue targeted for the next release.