wit-ai / wit

Natural Language Interface for apps and devices
https://wit.ai/
941 stars 91 forks source link

High confidence for incorrect utterances #2386

Closed CannonFodderr closed 2 years ago

CannonFodderr commented 2 years ago

Wit agent returns utterances attached to the wrong intents with confidence higher then 0.92 as well as out of scope utterances.

App ids: 1134614730693614 321292556446914

We see this issue more and more with newly created apps, we can also confirm it happens with English, Chinese and Thai languages. Retraining the app sometimes resolves the issue but in some cases (Like the apps above) it does not.

doggeral commented 2 years ago

@CannonFodderr

newly created apps

I believe these new apps are imported from the previous saved app files. We upgraded the model architecture and training infra, if you need to build new app, please create from scratch instead of importing from app file.

CannonFodderr commented 2 years ago

They are not imported, they are created via api requests. Also, We tried to open a new wit account and create few apps, issues was easily reproduced. Once few apps are created we experience 500 errors for some apps and for some we get high confidence for out of scope utterances.

For instance app id: 3130448873938618 (Created today with api calls) It has "Hello world" as out of scope and one intent with one utterance. If I submit "Hello world" as a message I get this response back:

{ "text": "Hello world", "intents": [ { "id": "1338296480015061", "name": "cats_intent", "confidence": 0.9951 } ], "entities": {}, "traits": {} }

We also get high confidence for messages which were never submitted as utterances to the app and 500 errors from time to time. We were able to reproduce this in many apps in 2 separate accounts with multiple languages. (Mostly English, Chinese, Japanese and Thai).

I attach few responses we got with some examples of Thai and English apps. In these apps intent is about cats, and Hello world is sent to be out of scope. (Same in both languages). thai out of scope Thai Thai3 Thai4 EN OUT OF SCOPE EN1

doggeral commented 2 years ago

For instance app id: 3130448873938618 (Created today with api calls)

Per the backend meta data, the app uses the deprecated model architecture, that's why your app encountered the intent issue. Same issue for 1134614730693614. Could you elaborate how you create these apps?

CannonFodderr commented 2 years ago

@doggeral I follow the wit documentation with creating the app: https://wit.ai/docs/http/20210928/#post__apps_link Just a post request, you can see the code in this gist: https://gist.github.com/CannonFodderr/1ef622b5f3344e80f3b412ad24d766d9

CannonFodderr commented 2 years ago

Btw, Because we started seeing this issue pop up when we had a lot of accounts we opened a new account for testing, these issues did not appear if we had 10 apps in the account but once we created over 200 apps issues started appearing in the testing account. We have many apps in the real production account suffering from this.

doggeral commented 2 years ago

@CannonFodderr could you help to share the app suffering from the issue in production with example request/response?

CannonFodderr commented 2 years ago

@doggeral We have many apps like this I will prepare a few app ids with request / response for you but I am wondering if the is a global fix that might be applied ?

CannonFodderr commented 2 years ago

Here are some production apps examples:

APP ID: 721836905469803 Language Japanese:

  1. "Hello world" is out of scope but returns a match to intent out of scope response out of scope

  2. Out of scope utterance in the same language as app returns attached to intent Out of scope in same language return attached to intent Out of scope in same language return attached to intent response

  3. "Test" is not in app utterances still returns with confidence to intent No existing utterance

  4. Utterance attached to intent returns as "out of scope" utterance attached to intent return as out of scope utterance attached to intent return as out of scope response

I will provide another examples of different apps languages apps soon

CannonFodderr commented 2 years ago

Another example in English app id: 953376005551498

  1. "Hello world" is out of scope but returns a match to intent out of scope out of scope response
  2. "Test" is not in app utterances still returns with confidence to intent not in app message 3.Another example for message which does not exist in the app utterance pool not in app message2
  3. Momentary dashboard error, this appeared for a minute and then disappeared error
CannonFodderr commented 2 years ago

English App id: 683291973090104 - new app created today Similar issues as in previous apps above:

  1. "Hello world" is out of scope but returns a match to intent
  2. "Test" is not in app utterances still returns with confidence to intent
  3. Training took a long time for just 2 utterances, in this time we got 500 errors back from the api
doggeral commented 2 years ago

@CannonFodderr Thanks for preparing the examples. Checked the data from our backend, the 683291973090104 953376005551498 uses the old model architecture, that's why the performance is low. I've migrated model for the two apps to new model architecture, the issue mentioned in your post should be fixed. We're investigating the root cause of creation issue.

CannonFodderr commented 2 years ago

@doggeral It is weird because as I said 683291973090104 was an app we created today for testing, shy does it open on the old model instead of the new one? How can we be sure new apps use the new model ?

Is it possible to check which apps are old model in a user account and migrate them all? These are just 2 out of multiple apps experiencing the issues

We also see these come up with new apps we create in our testing account

Also what about 721836905469803 I submitted in the examples above ? it has the same issue ?

CannonFodderr commented 2 years ago

@doggeral We are having those issues for one month now. Our company and product is utilizing your service to expose to 1000s of users around the world solutions in many different sectors.
Those users are greatly relying on your service and now are experiencing big disruptions. For us, it is really easy to reproduce the problem with every new application created, from our production and development accounts. We are really considering our options now and hope you will be able to solve this ASAP

doggeral commented 2 years ago

@CannonFodderr the issue has been fixed from our side. For the next step, could you

  1. create a new app to verify if it works?
  2. for the existing apps, could you share with me the app ids with production issue, I can help you to do the migrate.
benjo0010 commented 2 years ago

@doggeral So, for creating new apps, those are our observations: while an app that has been created via the dashboard is functioning well, an app that has been created via API call is not functioning well and providing the same bad results we have been experiencing in the past month. Those are the details

1. Good app id - 4984197714995950 - created from your dashboard. Behaves well, as expected 2. Bad app id - 532545664850753 - created via API call. Providing the same bad performances results. 3. Our admin app id - 1189127508177168

The API request for creating an app that always provides bad results

:curl --location --request POST 'https://api.wit.ai/apps' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer (our admin token) --data-raw '{ "name": "clientapp3", "lang": "en", "private": true }'

The API response { "app_id": "53ecf19d-ac95-44e6-b67b-5a3b9158b821", "access_token": "our access token" }

CannonFodderr commented 2 years ago

@doggeral As my colleague @benjo0010 state above, we are now able to get good results with apps that were created from the wit dashboard.

But Whenever creating apps wit api requests we expirience the same malfunctions.

Please see the details he share before. We tried it today with multiple apps

doggeral commented 2 years ago

@CannonFodderr could you share some app ids you created today with prediction issues?

CannonFodderr commented 2 years ago

@doggeral here are some apps I created today with API requests, all have prediction issues

492567715764777 - English 490294669401798 - Chinese 254640300200131 - Japanese

BTW, it is also very distinct that apps with issues like that:

  1. After app is created and completed the first training the first message request takes considerably more time to respond and always respond with 500 error.
  2. After 1 or 2 500 responses they will always return wrong intent for out of scope utterances
  3. They have a very long training.

All of the above does not happen created from the dashboard and not with API requests.

CannonFodderr commented 2 years ago

@doggeral Any update regarding this issue ?

doggeral commented 2 years ago

@CannonFodderr we're working on the fix now. Sorry for the late reply.

CannonFodderr commented 2 years ago

Thanks @doggeral please let me know if there is an estimation to when this issue may be fixed.

doggeral commented 2 years ago

@doggeral could you help to create the app via API to verify if the issue has been fixed?

CannonFodderr commented 2 years ago

We ran several test on multiple apps in multiple languages and could not reproduce the issue 🥳

Does the fix apply also for already existing apps which are malfunctioning? Ones that were created during the issue period?

doggeral commented 2 years ago

@CannonFodderr Thanks for the confirmation! Unfortunately it can't apply the existing apps, but you can provide the app list, I can help you to do the migration. Feel free to paste your affect app in another issue. Close the issue.