microsoft / BotFramework-Composer

Dialog creation and management for Microsoft Bot Framework Applications
https://docs.microsoft.com/en-us/composer/
MIT License
870 stars 372 forks source link

Multi language after deploy #4136

Closed Bernardo08pt closed 4 years ago

Bernardo08pt commented 4 years ago

Hello,

I have a project which I added another language using the new multilanguage feature. In this case I already had created the bot in english and added portuguese. I translated the bot and then I changed the deault language and the bot language to portuguese as you can see in the screenshot below.

image

Below is my local configuration

{ "feature": { "UseShowTypingMiddleware": false, "UseInspectionMiddleware": false, "RemoveRecipientMention": false }, "MicrosoftAppPassword": "", "MicrosoftAppId": "", "cosmosDb": { "authKey": "", "collectionId": "botstate-collection", "cosmosDBEndpoint": "", "databaseId": "botstate-db" }, "applicationInsights": { "InstrumentationKey": "" }, "blobStorage": { "connectionString": "", "container": "transcripts" }, "luis": { "name": "edpV3", "authoringKey": "xxxxxxxxxxx", "endpointKey": "", "authoringRegion": "westeurope", "defaultLanguage": "pt-br", "environment": "composer", "endpoint": "xxxxxxxxxxx", "authoringEndpoint": "" }, "qna": { "knowledgebaseid": "xxxxxxxxx", "hostname": "xxxxxxxxx", "endpointKey": "xxxxxxxxx", "subscriptionKey": "xxxxxxxxx", "qnaRegion": "westus" }, "telemetry": { "logPersonalInformation": false, "logActivities": true }, "runtime": { "customRuntime": false, "path": "", "command": "" }, "downsampling": { "maxImbalanceRatio": 10, "maxUtteranceAllowed": 15000 }, "defaultLanguage": "pt-br", "languages": [ "en-us", "pt-br" ] }

So far so good. I tested on the emulator and it worked as intended. When I change the locale on the emulator the bot starts speaking in the respective language and understands what I tell him in the respective language also.

The problem is when I deploy the bot. Below is my deploy configuration.

{ "accessToken": "xxxxxxxxxxxx", "name": "edp-test-bot", "environment": "dev", "settings": { "applicationInsights": { "InstrumentationKey": "<Instrumentation Key>" }, "cosmosDb": { "cosmosDBEndpoint": "<endpoint url>", "authKey": "<auth key>", "databaseId": "botstate-db", "collectionId": "botstate-collection", "containerId": "botstate-container" }, "blobStorage": { "connectionString": "<connection string>", "container": "<container>" }, "luis": { "authoringKey": "xxxxxxxxxxxxxxxxxxxx", "authoringEndpoint": "xxxxxxxxxxxxxxxxxxxxx", "endpointKey": "xxxxxxxxxxxxxxxxx", "endpoint": "xxxxxxxxxxxxxxxxxxxxxxx", "region": "westeurope", "defaultLangage": "pt-br" }, "MicrosoftAppId": "xxxxxxxxxxxx", "MicrosoftAppPassword": "xxxxxxxxxxxxxxxxx" }, "hostname": "edp-testbot", "luisResource": "edp-testbot-luis", "defaultLanguage": "pt-br" }

The problem is that the bot starts speaking in portuguese but it only understands when I talk in english, so it is checking on the en-us apps that are on LUIS instead of checking the pt-br ones. I'm using the same LUIS resource for local and for the prooduction version. I added the "defaultLanguage" properties with hope it would fix my problem but it had no effect.

Can you please check if there is something wrong with my configurations. Also below is an image showing that both en-us and pt-br apps exist on LUIS.

image

Bernardo08pt commented 4 years ago

An update

I tried to deploy the chatbot with only the portuguese language (eliminated the english) and it still does not work, it starts talking to me in portuguese but when I talk to him it seems it doesn't reach the LUIS service.

It continues to work ok locally in the emulator

cwhitten commented 4 years ago

@Bernardo08pt can you share the information coming from the LuisTrace log when testing in the Emulator?

Bernardo08pt commented 4 years ago

Do you mean this

image

luhan2017 commented 4 years ago

@Bernardo08pt , thanks for reporting this, there is a bug in our azure deployment logic, we take the language field from the publishing profile instead of defaultLanguage, you can mitigate this issue by just updating your profile, replace the defaultLanguage with language.

{
    "accessToken": "xxxxxxxxxxxx",
    "name": "edp-test-bot",
    "environment": "dev",
    "settings": {
        "applicationInsights": {
            "InstrumentationKey": "<Instrumentation Key>"
        },
        "cosmosDb": {
            "cosmosDBEndpoint": "<endpoint url>",
            "authKey": "<auth key>",
            "databaseId": "botstate-db",
            "collectionId": "botstate-collection",
            "containerId": "botstate-container"
        },
        "blobStorage": {
            "connectionString": "<connection string>",
            "container": "<container>"
        },
        "luis": {
            "authoringKey": "xxxxxxxxxxxxxxxxxxxx",
            "authoringEndpoint": "xxxxxxxxxxxxxxxxxxxxx",
            "endpointKey": "xxxxxxxxxxxxxxxxx",
            "endpoint": "xxxxxxxxxxxxxxxxxxxxxxx",
            "region": "westeurope",
            "defaultLangage": "pt-br"
        },
        "MicrosoftAppId": "xxxxxxxxxxxx",
        "MicrosoftAppPassword": "xxxxxxxxxxxxxxxxx"
    },
    "hostname": "edp-testbot",
    "luisResource": "edp-testbot-luis",
    "language": "pt-br"
}