simulation_utils¶
Utility functions to run the simulation.
Functions¶
|
Maps a class path to a class. |
|
Gets the agent information. |
|
Gets the simulator information. |
|
Returns an NLU component. |
Trains a cosine classifier on annotated dialogues for NLU module. |
|
Trains a DIET classifier on Rasa annotated dialogues for NLU module. |
Module Contents¶
- simulation_utils.map_path_to_class(cls_path: str) Type ¶
Maps a class path to a class.
- Parameters:
cls_path – Class path.
- Returns:
Class.
- simulation_utils.get_agent_information(config: confuse.Configuration) Tuple[Type, Dict[str, Any]] ¶
Gets the agent information.
- Parameters:
config – Configuration of the run.
- Raises:
TypeError – if agent class does not inherit from Agent.
- Returns:
Agent class and agent configuration.
- simulation_utils.get_simulator_information(config: confuse.Configuration) Tuple[str, Type, Dict[str, Any]] ¶
Gets the simulator information.
- Parameters:
config – Configuration of the run.
- Raises:
ValueError – If the simulator class is not supported.
- Returns:
Simulator ID, simulator class, and configuration.
- simulation_utils.get_NLU(config: confuse.Configuration) dialoguekit.nlu.NLU ¶
Returns an NLU component.
Only supports disjoint dialogue act extractors for now.
- Parameters:
config – Configuration for the simulation.
- Raises:
ValueError – Unsupported intent classifier.
- Returns:
An NLU component.
- simulation_utils.train_cosine_classifier(config: confuse.Configuration) dialoguekit.nlu.models.intent_classifier_cosine.IntentClassifierCosine ¶
Trains a cosine classifier on annotated dialogues for NLU module.
- Parameters:
config – Configuration generated from YAML configuration file.
- Returns:
A trained cosine model for intent classification.
- simulation_utils.train_rasa_diet_classifier(config: confuse.Configuration) dialoguekit.nlu.models.diet_classifier_rasa.IntentClassifierRasa ¶
Trains a DIET classifier on Rasa annotated dialogues for NLU module.
- Parameters:
config – Configuration generated from YAML configuration file.
- Returns:
A trained Rasa DIET model for intent classification.