Digital Assistant and Mobile

Get Involved. Join the Conversation.

Topic

    Ameur Baccoucha
    Translation problem with the facebook channelAnswered
    Topic posted August 28, 2018 by Ameur BaccouchaGold Medal: 3,500+ Points, tagged Bots, Facebook, Messaging 
    97 Views, 8 Comments
    Title:
    Translation problem with the facebook channel
    Summary:
    I use the google translation service and everything is fine in the botui tester but it does not work in the Facebook channel.
    Content:

    Hello,

    everything work on the botUI tester but in the facebook channel when I type "hi", I receive the welcome message that I put in english. but when I type "bonjour" I receive the message of the "unresolvedIntent" in english.
    any idea please.
    Thank you

    Best Comment

    Ameur Baccoucha

    i find the probleme i use the detect language after the "System.Intent" . so waht i did i just i put those states before that component:

    setAutoTranslate:
        component: "System.SetVariable"
        properties:
          variable: "autoTranslate"
          value: true
        transitions: {}
      detect:
        component: "System.DetectLanguage"
        properties: {}
        transitions: {}
      translate:
        component: "System.TranslateInput"
        properties:
          variable: "translatedString"
        transitions: {}
      intent:
        component: "System.Intent"
        properties:
          variable: "iResult"
          confidenceThreshold: 0.4
          sourceVariable: "translatedString"
          translate: true
        transitions:
          actions:
            Greeting: "startGreeting"
            Reservation: "askForDestinAir"
            unresolvedIntent: "unresolved"

    Comment

     

    • Frank Nimphius

      Hi,

       

      try the tester. If this is correct here then the problem may be with Facebook. To investigate, you can try an add a System.Text component as a component before the System.Intent. Have the System.Text component saving the user inout in a variable. Then print the message to see if Facebook translates it to English. 

      Anything else is hard to say here as we don't know how your dialog flows sets up translation. E.g. do you use translate: true . in the System Intent component?

      Frank

    • Ameur Baccoucha

      this is my dialog flow and it works fine with the tester a have the probleme juste with the fb channel some times it work and some times no crying
       

       translateInput:
          component: "System.TranslateInput"
          properties:  
            # variable refers to the context or user variable that stores the translated text.
            variable: "translatedString"
        intent:
          component: "System.Intent"
          properties:
            variable: "iResult"
            confidenceThreshold: 0.4
            sourceVariable: "translatedString"
            translate: true
          transitions:
            actions:
              Greeting: "detectGreeting"
              Reservation: "detectReservation"
              unresolvedIntent: "unresolved"
      ############################################################## Greeting
        detectGreeting:
          component: "System.DetectLanguage"
        enableAutotranslationGreeting:
          component: "System.SetVariable"
          properties:
            variable: "autoTranslate"
            value: true
          transitions: {}
        startGreeting:
          component: "System.Output"
          properties:
            text: "Hello ${profile.firstName}, I am NouvelBot and I will be glad to assist you. :)"
          transitions:
            return: "startGreeting"

    • Frank Nimphius

      Can you look at the value of the ${profile.locale} setting ? Also I see - if this is the complete YAML - that you don't call System.DetectLanguage, which means that the bot doesn't determine language from the suer input

      Frank

      • Ameur Baccoucha

        "profile.locale": "fr-FR",
        i did use the
        System.DetectLanguage just before startGretting state. Here my complete YAML maybe it will help.

        #metadata: information about the flow
        #  platformVersion: the version of the bots platform that this flow was written to work with 
        metadata:
          platformVersion: 1.0
        main: true
        name: NouvelPOC
        context:
          variables:
            iResult: "nlpresult"
            departAir: "Depart_Airport"
            destinAir: "Destin_Airport"
            departDate: "Depart_Date"
            destinDate: "Arrival_Date"
            tripType: "TripType"
            childNum: "Child"
            infantNum: "Infant"
            adltNum: "Adlt"
            offers: "string"
            autoTranslate: "boolean"
            translatedString: "string"
        states:
          translateInput:
            component: "System.TranslateInput"
            properties:  
              # variable refers to the context or user variable that stores the translated text.
              variable: "translatedString"
          intent:
            component: "System.Intent"
            properties:
              variable: "iResult"
              confidenceThreshold: 0.4
              sourceVariable: "translatedString"
              translate: true
            transitions:
              actions:
                Greeting: "detectGreeting"
                Reservation: "detectReservation"
                unresolvedIntent: "unresolved"
        ############################################################## Greeting
          detectGreeting:
            component: "System.DetectLanguage"
          enableAutotranslationGreeting:
            component: "System.SetVariable"
            properties:
              variable: "autoTranslate"
              value: true
            transitions: {}
          startGreeting:
            component: "System.Output"
            properties:
              text: "Hello ${profile.firstName}, I am NouvelBot and I will be glad to assist you. :)"
            transitions:
              return: "done"
        ############################################################## Ask for Destination Airport
          detectReservation:
            component: "System.DetectLanguage"
          enableAutotranslationDestinAir:
            component: "System.SetVariable"
            properties:
              variable: "autoTranslate"
              value: true
            transitions: {}
          askForDestinAir:
            component: "System.Text"
            properties:
              variable: "destinAir"
              nlpResultVariable: "iResult"
              prompt: "Please provide your destination airport."
            transitions: {}
        ############################################################## Ask for Departure Airport
          askForDepartAir:
            component: "System.Text"
            properties:
              variable: "departAir"
              nlpResultVariable: "iResult"
              prompt: "Please provide your departure airport."
            transitions: {}
        ############################################################## Ask for Departure Date
          askForDepartDate:
            component: "System.Text"
            properties:
              variable: "departDate"
              nlpResultVariable: "iResult"
              prompt: "Please provide your Departure date."
            transitions: {}
        ############################################################## Arrival Date
          setDestinDate:
            component: "System.SetVariable"
            properties:
              variable: "destinDate" 
              value: "${iResult.value.entityMatches['Arrival_Date'][0]}"
        ############################################################## ADLT Number
          setAdltNum:
            component: "System.SetVariable"
            properties:
              variable: "adltNum" 
              value: "${iResult.value.entityMatches['Adlt'][0]}"
        ############################################################## CHILD Number
          setChildNum:
            component: "System.SetVariable"
            properties:
              variable: "childNum" 
              value: "${iResult.value.entityMatches['Child'][0]}"
        ############################################################## Infant Number
          setInfantNum:
            component: "System.SetVariable"
            properties:
              variable: "infantNum" 
              value: "${iResult.value.entityMatches['Infant'][0]}"
        ############################################################## Verification About the Round Trip
          conditionEquals:
            component: "System.ConditionEquals"
            properties:
              variable: "destinDate"
              value: null
            transitions:
              actions:
                equal: "askForTripType"
                notequal: "askForAdltNum"
        ############################################################## Trip Type
          askForTripType:
            component: "System.List"
            properties: 
              prompt: "what is the type of your trip?"
              options: 
              - label: "One Way"
                value: "ONE_WAY" 
              - label: "Round Trip"
                value: "ROUND_TRIP" 
              variable: "tripType"
              nlpResultVariable: "iResult"       
            transitions:
              actions:
                ONE_WAY: "askForAdltNum"
                Round Trip: "askForDestinDate"
        ############################################################## Ask for Arrival Date Verification
          askForDestinDate:
            component: "System.Text"
            properties:
              variable: "destinDate"
              prompt: "Please provide your return date."
            transitions: {}
        ############################################################## Ask for ADLT Number
          askForAdltNum:
            component: "System.Text"
            properties:
              variable: "adltNum"
              prompt: "How much adults in this flight?"
            transitions: {}
        ############################################################## Ask for CHILD Number
          askForChildNum:
            component: "System.Text"
            properties:
              variable: "childNum"
              prompt: "How much children are there?"
            transitions: {}
        ############################################################## Ask for INFANT Number
          askForInfantNum:
            component: "System.Text"
            properties:
              variable: "infantNum"
              prompt: "How much infants are there?"
            transitions: {}    
        ############################################################## Offers Retrieve
          populateOffers:
            component: "vols.offers"
            properties:
              offers: "offers"
              departAir: "${departAir.value}"
              destinAir: "${destinAir.value}"
              departDate: "${departDate.value.date?number_to_datetime}"
              destinDate: "${destinDate.value.date?number_to_datetime}"
              tripType: "${tripType.value}"
              childNum: "${childNum.value.number}"
              infantNum: "${infantNum.value.number}"
              adltNum: "${adltNum.value.number}"     
        ############################################################## Offers Display
          cardResponse:
            component: "System.CommonResponse"
            properties:
              metadata: 
                responseItems:         
                - type: "cards"  
                  cardLayout: "vertical"
                  cards:
                  - title: "${offers.title}"
                    description: "${offers.description}"
                    iteratorVariable: "offers" 
                    # actions defined here are added to the card.  
                    actions: 
                    - label: "Details"
                      # action type allowable values are: postback, url, share, call, location.
                      type: "url"
                      payload: 
                        url: "${offers.url}"
              processUserMessage: false          
            transitions:
              return: "done"            
        ############################################################## Unresolved
          unresolved:
            component: "System.Output"
            properties:
              text: "I did not get you. Please visite our site for more information."
            transitions:
              return: "unresolved"

    • Ameur Baccoucha

      i find the probleme i use the detect language after the "System.Intent" . so waht i did i just i put those states before that component:

      setAutoTranslate:
          component: "System.SetVariable"
          properties:
            variable: "autoTranslate"
            value: true
          transitions: {}
        detect:
          component: "System.DetectLanguage"
          properties: {}
          transitions: {}
        translate:
          component: "System.TranslateInput"
          properties:
            variable: "translatedString"
          transitions: {}
        intent:
          component: "System.Intent"
          properties:
            variable: "iResult"
            confidenceThreshold: 0.4
            sourceVariable: "translatedString"
            translate: true
          transitions:
            actions:
              Greeting: "startGreeting"
              Reservation: "askForDestinAir"
              unresolvedIntent: "unresolved"

    • Abhishek Singh

      Recently, i have integrated my bot with facebook channel. The bot is responding only to me(developer) when logged in as developer user credentials to facebook messenger, but it is not responding to general public. What is the next step to make it available to general public?

      Thanks,

      Abhishek

    • Frank Nimphius

      Abhishek, Ameur,

       

      please don't hijack this thread. If you seek for answers, you get better visibility starting your own thread

       

      Frank