Created
December 21, 2017 13:29
-
-
Save ZackStone/8f14277cf2f896ecbfd446e582e3752e to your computer and use it in GitHub Desktop.
Exportar dados do bot para planilha
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
# -*- coding: utf-8 -*- | |
""" | |
Created on Thu Dec 21 10:32:59 2017 | |
@author: yitzhak.andrade | |
Extrair as intenções identificadas e os textos digitados pelos usuários e exportar para uma planilha. | |
""" | |
import pandas as pd | |
import json | |
FILENAME = 'chatbot-ti.json' | |
#%% | |
with open(FILENAME, encoding='utf-8') as file: | |
bot_json = json.load(file) | |
#%% | |
obj = pd.DataFrame.from_dict(bot_json, orient='index') | |
json_hist = obj.loc['utterances'][0] | |
#%% | |
df_out = pd.DataFrame.from_dict(json_hist) | |
writer = pd.ExcelWriter('chatbot-ti.xlsx') | |
df_out.to_excel(writer,'Sheet1') | |
writer.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment