Support other recipes - starting with graph #10473
Labels
area:rasa-oss 🎡
Anything related to the open source Rasa framework
effort:atom-squad/4
Label which is used by the Rasa Atom squad to do internal estimation of task sizes.
type:enhancement ✨
Additions of new features or changes to existing ones, should be doable in a single PR
What problem are you trying to solve?
Currently we only have a single recipe type called
default.v1
which fits most cases but falls short of advanced configuration. For research teams and other users who want customised recipes, we want to add a feature to modularly load different types of recipes.This will be released with a minor version (merge to main branch), ie. released as a 3.x version.
What's your suggested solution?
For the minimum viable product, we want to support graph schemas so research can specify graph components/nodes as they like.
TrainingType
intoengine/recipes/recipe.py
. This file has base recipe class and other classes common to other recipes.shared/importers/autoconfig.py
to default recipe atengine/recipes/default_recipe.py
. Default recipe itself will know how to validate the recipe and correct it (dumping missing keys etc.) and every new recipe from now on too will hold that information - high cohesion, low coupling.RasaFileImporter.get_config
so that it instantiates correct recipe, ie.model_training._train_graph
so it can get model config directly:Add new recipe option
graph.v1
by adding new moduleengine.recipes.graph_recipe
and in it classGraphV1Recipe
. Add this class to the optionsrecipes
inRecipe.recipe_for_name
method.For the new
GraphV1Recipe
, don't worry about validation or dumping default values etc. as this is an experimental and advanced feature which will evolve over time. We can add validation in a later step; default policies or pipeline components are not needed because we want more control over the graph with this recipe. Mark as experimental so users know this feature can change.GraphV1Recipe
will read a single file which has graph schema defined and can be directly used (no need to transform into usable format like in the default recipe). File is simply:Note we have language and recipe at the top and we have divided train and predict schema nodes.
In
GraphV1Recipe
class, simply loadtrain
andpredict
schemas from the recipe; nothing else is needed. Changegraph_config_for_recipe
so that it returns:Attributes other than train/predict schema can be shared between default and graph recipe, ie. training_type, language, core and nlu targets are used similarly in both recipes. For schemas, current default recipe will continue processing it while the new graph schema will use
GraphSchema.from_dict
to directly use what's in the graph schema file.Definition of Done
The text was updated successfully, but these errors were encountered: