Skip to content

Instantly share code, notes, and snippets.

@Darshan2104
Created November 16, 2022 05:51
Show Gist options
  • Save Darshan2104/25bb899465125f4453a32cd980ed5cbb to your computer and use it in GitHub Desktop.
Save Darshan2104/25bb899465125f4453a32cd980ed5cbb to your computer and use it in GitHub Desktop.
To create nlu.md file from json formated input used in rasa
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