Created
June 28, 2018 20:29
-
-
Save MatthewScholefield/611b0dd9cdff82e135fb4e855d77e826 to your computer and use it in GitHub Desktop.
Convert padatious intent lines to rasa training data json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Dict | |
def create_rasa_training_data(intent_lines: Dict[str, list]) -> Dict: | |
return { | |
'rasa_nlu_data': { | |
'common_examples': sum([ | |
[ | |
{ | |
"text": line, | |
"intent": intent, | |
"entities": [] | |
} | |
for line in lines | |
] | |
for intent, lines in intent_lines.items() | |
], []) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment