Skip to main content

Dialogflow to Rasa > 3.0 agent converter.

Project description

Dialog2Rasa Converter

Build Status PyPI version Python Versions License

Convert Dialogflow agents to Rasa format easily. Supports Rasa 3+.

For a detailed architecture flow, see the Conversion Process Diagram.

Installation

Install dialog2rasa with:

pip install dialog2rasa

For more details, visit PyPI.

Usage

Export your Dialogflow agent (details here), unzip it, and then, convert it to Rasa format with:

dialog2rasa -p path/to/extracted/dialogflow/export -l language_code -v

Command Details

  • -p PATH: Path to the Dialogflow export’s extracted folder.
  • -l LANGUAGE (optional): Language code (e.g., 'en' for English), defaults to 'de' (German).
  • -v VERBOSE (optional): Increase output verbosity for debugging purposes, defaults to 'False'.

The conversion output is saved in /output/[LANGUAGE_CODE] within the Dialogflow agent’s directory, with [LANGUAGE_CODE] being the actual language code used.

Output File Format

For detailed insights into how the output data is structured, visit our documentation here.

Features and Limitations

Converts intents, entities, and utterances to Rasa YAML.

Limitations

  • Compound Entity Conversion: Generates __compound_ prefixed pseudo-YAML for Rasa's unsupported compound entities, allowing for custom handling by the user.

  • Entity Conversion Strategy: Our approach involves two distinct methods based on the number of synonyms associated with each reference value.

    • Single Synonym Entities: Dialogflow entities that have reference values with only one synonym each are consolidated into a Rasa lookup table. This table is named after the original Dialogflow entity. This method facilitates efficient entity recognition in Rasa for these cases, since it usually indicates a Dialogflow design choice of accumulating synonyms as reference value, which which can increase very quickly. Hence, should be more easily manageable and readable via lookup tables.
    • Multiple Synonyms Entities: For Dialogflow entities where reference values have multiple synonyms, we create a corresponding Rasa entity. In these instances, extra synonyms are grouped under their respective reference value to maintain the nuanced relationships between them. Typically, the number of synonyms is smaller here, making it easier to digest and maintain within the nlu.yml under the synonym key.

This approach comes from what we've seen work in practice, showing that Rasa tends to do a better job of capturing entities this way. However, we're completely open to the idea that there may be other, possibly better ways to do this in certain cases. If you have any ideas or suggestions on how to tweak or improve this part, we'd love to hear them!

Note: See the Output File Format here to understand these limitations.

Contributing

Your feedback and contributions are appreciated to enhance this tool. Report bugs or suggest features via issues or pull requests.

Testing

The package includes automated tests that are run in two Continuous Integration workflows:

  • PR Validation CI: Tests are run on pull requests to ensure code quality and functionality before merging (more details here).
  • Python Publish: Upon merging, tests are run again before deployment to PyPI (more details here).

Please contribute by writing tests with pytest for your code changes to maintain functionality and reliability.

License

Licensed under the Apache 2.0 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dialog2rasa-0.1.19.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

dialog2rasa-0.1.19-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file dialog2rasa-0.1.19.tar.gz.

File metadata

  • Download URL: dialog2rasa-0.1.19.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for dialog2rasa-0.1.19.tar.gz
Algorithm Hash digest
SHA256 8e4fd33ae0beb8683db99e2f66c0877aac167077c54e2acc02e529da523c8599
MD5 8b639c5d4cbd1f96a1bdc8f4ee630917
BLAKE2b-256 d037d4d32eeb45f4df8676f7d9db953b84eca4815daf13b410a7d37e982e7157

See more details on using hashes here.

File details

Details for the file dialog2rasa-0.1.19-py3-none-any.whl.

File metadata

File hashes

Hashes for dialog2rasa-0.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 99483a00f9709defc7f74bf8265bdaf28fce70ebca9663b70cebb206cf992eae
MD5 c986f94d53f6704ec2c14f21e90ea9a2
BLAKE2b-256 ce2ffe4c3a2a87005431eb896f105fb7d185806fa6b1e8aab74c43c4662ee545

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page