Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
940 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 Answer

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:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...