mindmeld.converter package¶
-
class
mindmeld.converter.
RasaConverter
(rasa_project_directory, mindmeld_project_directory)[source]¶ Bases:
mindmeld.converter.converter.Converter
The class is a sub class of the abstract Converter class. This class contains the methods required to convert a Rasa project into a MindMeld project
-
convert_project
()[source]¶ Main function that will convert a Rasa project into a MindMeld project.
- The Rasa project consists of three major files that contain much of data
- that is converted into the MindMeld project:
- /domain.yml - Contains all of the intents, entities, actions, and templates
- used in the rasa project
- /data/stories.md - Contains the stories which are used to match intents and
- actions together
- /data/nlu_data.md - Contains the training data for each intent. Some of the
- training data may contain entities
limitations: - Rasa has the ability to handle multiple intents per query, while MindMeld does not. - Rasa training data may be json format, which is not currently supported. - Rasa has a feature called Rasa forms which is not currently supported. - Rasa's configuration files are not transfered, instead generic MindMeld configuration files are copied over.
-
-
class
mindmeld.converter.
DialogflowConverter
(dialogflow_project_directory, mindmeld_project_directory, custom_config_file_path=None, language='en')[source]¶ Bases:
mindmeld.converter.converter.Converter
The class is a sub class of the abstract Converter class. This class contains the methods required to convert a Dialogflow project into a MindMeld project
-
clean_check
(name, lst)[source]¶ Takes in a list of strings and a name. Returns name cleaned if the cleaned name is not found in lst.
-
static
clean_name
(name)[source]¶ Takes in a string and returns a valid folder name (no spaces, all lowercase).
-
convert_project
()[source]¶ Converts a Dialogflow project into a MindMeld project.
- Dialogflow projects consist of entities and intents.
- note on languages:
- Dialogflow supports multiple languages and locales. They store their training data for different languages in different files. So, the name of each training file ends with a meta tag, two letters long for language, and an additional two letters for dialect (if applicable). For example, a file ending in "_en-au" indicates it's in English (Australia). Below we use "la" to represent this meta tag.
- entities folder contains:
- entityName.json - Meta data about entityName for all languages. entityName_la.json - One for each language, contains entitiy mappings.
- intents folder contain:
- intentName.json - Contains rules, information about conversation flow, meta data.
- Contains previously mentioned information and responses for all languages.
- intentName_usersays_la.json - one for each language,
- contains training data to recognize intentName
Limitations: - The converter is unable to create an entity when it encounters an unrecognized entity (an entity not defined under entities folder
or system entities), and labels such entities as DNE in training data.- The converter currently does not automatically convert features like
slot filling, contexts, and follow-up intents. Users can still implement such features and more. - Information in agent.json are not copied over. - There is no official support for different languages. Users can still implement this. The converter is able to successfully convert dialogflow bots that support multiple languages.
MindMeld: - Users can store data locally - Users can build a knowledge base (currently beta in Dialogflow). - Users can configure the machine learning models to best suit their needs. - Users have more flexibility in defining their own features, including
ones like slot filling, contexts, and follow-up intents.
-
create_mindmeld_training_data
()[source]¶ Converts traning data from other software into MindMeld training data.
-
sys_entity_map
= {'@sys.cardinal': 'sys_number', '@sys.date': 'sys_time', '@sys.date-period': 'sys_interval', '@sys.date-time': 'sys_interval', '@sys.duration': 'sys_duration', '@sys.email': 'sys_email', '@sys.number': 'sys_number', '@sys.ordinal': 'sys_ordinal', '@sys.phone-number': 'sys_phone-number', '@sys.temperature': 'sys_temperature', '@sys.time': 'sys_time', '@sys.time-period': 'sys_duration', '@sys.unit-currency': 'sys_amount-of-money', '@sys.unit-volume': 'sys_volume', '@sys.url': 'sys_url'}¶
-
sys_entity_map_todo
= ['@sys.number-integer', '@sys.number-sequence', '@sys.flight-number', '@sys.unit-area', '@sys.unit-length', '@sys.unit-speed', '@sys.unit-information', '@sys.percentage', '@sys.age', '@sys.currency-name', '@sys.unit-area-name', '@sys.unit-length-name', '@sys.unit-speed-name', '@sys.unit-volume-name', '@sys.unit-weight-name', '@sys.unit-information-name', '@sys.address', '@sys.zip-code', '@sys.geo-capital', '@sys.geo-country', '@sys.geo-country-code', '@sys.geo-city', '@sys.geo-state', '@sys.geo-city', '@sys.geo-state', '@sys.place-attraction', '@sys.airport', '@sys.location', '@sys.given-name', '@sys.last-name', '@sys.person', '@sys.music-artist', '@sys.music-genre', '@sys.color', '@sys.language', '@sys.any']¶
-