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 pandas as pd | |
input_file_name = 'Tamil_NLU_Collation.xls' | |
# update it based on your xl file. | |
sheets = ['Generic NLU', 'Generic FAQs', 'Collection_Response+FAQ Intent'] | |
output_file = open('result/nlu.md',"w") | |
list_intents = open('result/list_intent.txt',"w") | |
for sheet in sheets: |
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 pandas as pd | |
import json | |
# read nlu.md | |
# create a list of intent and it's nlus | |
# for each intent | |
# each nlu call api | |
# get result and store it | |
# store it into the new db | |
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)) |