Created
November 16, 2022 05:51
-
-
Save Darshan2104/25bb899465125f4453a32cd980ed5cbb to your computer and use it in GitHub Desktop.
To create nlu.md file from json formated input used in rasa
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
import json | |
f = open('final.json') | |
data = json.load(f) | |
# data = {"intent : byebye": ["bye bye", "aav jo", "tata", "gaya"]} | |
file = open('nlu.md',"w") | |
for key,val in data.items(): | |
file.write(f"## {key}\n") | |
val = list(set(val)) | |
for i in val: | |
file.write(f"- {i}\n") | |
file.write("\n") | |
print(key,val) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment