question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Motivation

After doing https://github.com/RasaHQ/rasa/issues/3302, the next step is to be able to scope intents. Currently intents, entities, actions and so on are merged by default. With this enhancement we want to make it possible to add a scope / namespace to a skill import so that you can avoid overlapping.

Example:

Consider imports like:

imports:
  - Skill A
  - Skill B

If both Skill A and Skill B have an intent greet the training data for this intent is currently merged.

Proposed implementation

Config file

The easiest is to use a : to indicate a scoping since that’s a yaml dictionary then

imports:
  - Skill A: scope1
  - Skill B

Applying the scopes

The tricky part is:

  • to rename things in stories, domain, nlu training data
  • separate the scoping since it’s only used with skills

TrainingFileImporter

Making the file loading components easily replaceable without affecting any other code.

SkillImporter

Currently the SkillSelector only picks up the config files along the way. In SkillSelector._from_directory we now also have to find and load story files / domains / nlu training files. These files can then be merged as the skills are merged.

Regarding the scoping:

  • We could either do everything from SkillImporter which requires the individual classes (e.g. Domain to expose a lot externals to SkillImporter
  • add function scope to Domain, TrainingData, DialogueStateTracker (more intrusive, but less connections between classes + easier testable)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
wochingecommented, Jun 28, 2019

I see your point now. Maybe the point of this issue should then be to make the file loading in Rasa more modular, which means

  • the logic is centralized in a component
  • it can be easily exchanged by a different component (similar to how we can exchange policies, custom components now).

By having this alternative / experimental file loading approaches could be implemented / maintained as separate modules / libraries.

We can also do a architectural review in two weeks or so where we can discuss different approaches to achieve this modularity

1reaction
wochingecommented, Jun 27, 2019

This seems like a lot of code complexity.

That’s true, but due to the used interface the implementation would be strictly separated from how the current file loading works. Also we could reduce some code debt, since currently the file loading is distributed all over the code and we could use the proposed interface to centralize it.

it’s not simpler to just write a shell script that prepends the skill name in the nlu & stories files?

A shell script would permanently do these changes to the NLU & story files. However, we just need these changes during training time.

Can you give an example of where this is needed

This is needed when two teams each develop multiple independent skills, whose intents, entities, slots, etc shouldn’t overlap. E.g. two skills could have an action utter_address, but once it should be sth like This restaurant is in {address}. and once it’s Ok, I saved your home address {address}. (sorry, it’s hard to come up with a good example 😄 ).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stressors: Coping Skills and Strategies - Cleveland Clinic
What are some common coping strategies? · Lower your expectations. · Ask others to help or assist you. · Take responsibility for the...
Read more >
Healthy Coping Skills for Uncomfortable Emotions
The five main types of coping skills are: problem-focused coping, emotion-focused coping, religious coping, meaning-making, and social support.
Read more >
10+ Coping Skills Worksheets for Adults and Youth (+ PDFs)
Good Coping Skills · Practicing meditation and relaxation techniques; · Having time to yourself; · Engaging in physical activity or exercise; · Reading;...
Read more >
99 Coping Skills - Your Life Your Voice
We created a list of 99 Coping Skills. Save it or print it to take it with you so you'll always remember them!...
Read more >
Develop a Battery of Coping Skills | Called to Care
Develop a Battery of Coping Skills ... Coping can be defined as the efforts we make to manage situations we have appraised as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found