mindmeld.converter.dialogflow module

This module contains the DialogflowConverter class used to convert Dialogflow projects into MindMeld projects

class mindmeld.converter.dialogflow.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_directory()[source]

Creates key MindMeld folders for project.

create_mindmeld_init()[source]

Creates MindMeld __init__.py file.

create_mindmeld_training_data()[source]

Converts traning data from other software into MindMeld training data.

generate_handlers(intent, response)[source]
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']