botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
69 stars 83 forks source link

No spaces in NLU extracted slots #888

Closed kercos closed 4 years ago

kercos commented 4 years ago

Describe the bug When I define a slot with spaces (e.g, i want to book a flight to [new york]) the system correctly detects them but in {{event.nlu.slots.slotname.value}} I see them without spaces (newyork).

This issue has been addressed by iicky in the forum (https://help.botpress.io/t/no-spaces-in-nlu-extracted-slots/2602). User Estyms suggested to solve it with an ad hoc function parsing again the sentence to find the slot, but I don't this this is a very elegant solution. I believe this is a bug of the NLU module and should be solved internally.

To Reproduce Steps to reproduce the behavior:

  1. In NLU, define a new entity toCity with rome, new york, toronto, paris
  2. Define a new intent Fights and add new sentences (including i want to flight to new york)
  3. Create a new slot for this intent with type toCity
  4. Tag all cities in the sentences with this slot
  5. In the emulator type the sentence i want to flight to new york and look at the debugging info.

Expected behavior event.nlu.slots.toCity.value should be new york instead of newyork

Screenshots image

image

image

Environment (please complete the following information):

EFF commented 4 years ago

Fixed with botpress/botpress#2660 , will be available in next release 12.2.4. Thank you for reporting this. Working example available here