Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
889 views
in Technique[技术] by (71.8m points)

yaml - How to escape special characters in RASA intent examples?

I am trying to create simple RASA assistant, which will be able to answer me back the ID numbers of some specific applications based on their names. The problem is that these application's names often contains or ends with special characters like ), / or _ and I can't find out how to escape these special characters. My NLU yaml file looks like this:

nlu.yml:

  - intent: q01
    examples: |
      - what is the ID of the application [NGSSM_NC_TOMS_SUITE_A/T_(P)](appl_name)?

I tried to escape these characters with , / and also tried to wrap whole string into " and ' but nothing solved that problem.

This is not the biggest problem because I can partially solve this by training my RASA assistant with example(s), where I delete all these special characters and my RASA assistant will still gonna assign real input into correct slot (in this case into appl_name slot). The biggest problem is that the real input from the real user(s) still gonna contains these special characters which causes problems. My RASA assistant is able to store this input into correct entity, but not able to store this input correctly. For example, the real input NGSSM_NC_TOMS_SUITE_A/T_(P) is stored as NGSSM_NC_TOMS_SUITE_A/T_(P.

Also I have to mention that I'm pretty newbie in YAML language as well as RASA development. Thanks for every solution and suggestion. :)

question from:https://stackoverflow.com/questions/65846466/how-to-escape-special-characters-in-rasa-intent-examples

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I think your solution would be to use a different entity extractor such as the RegexEntityExtractor which is able to handle special characters. See the docs here and here. Also see these related forum posts:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...