Does watson conversation intents and entities support regular expressions?

前端 未结 3 1432
长情又很酷
长情又很酷 2021-01-22 06:04

I\'m testing Watson Conversation API with a possible dialog my company wants to create. We are developing with Brazilian Portuguese. Given the portugues is a rich language and s

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-22 06:42

    You cannot use regular expressions in intents or entities however I think you should still be able to cope with variations.

    There is currently no built in handling of typos or accent normalization when matching intents however if there are enough features in a sentence to match on, the occasional typo shouldn't cause problems. For very short examples, there may be some value in adding additional examples for common mistakes.

    For entities, you can include synonyms and I have used that to include common mistakes before.

    You shouldn't try to include a reference to an entity directly in your intents. For example, rather than Qual a @(producao) you should just have Qual a produção, along with other examples of the same intent, perhaps with different entities, or different synonyms for the same entity. For example, I might have the following examples for a #directions intent...

    • How do I get to the hotel by car?
    • Can you give me directions to the hotel by road?
    • Which is the nearest station if I travel by train
    • Which bus route will get me to the hotel?

    Along with values like car, bus, train, bicycle, etc. for a @transport entity. (Sorry I can't give a Brazilian Portuguese example!) There's no need to explicitly name the entity/entities you're expecting to find in an intent.

    And finally, you can use regular expressions in conditions on dialog nodes, for example...

    input.text.matches( 'produ[cç][aã]o' )

提交回复
热议问题