Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ from scrape_3gpp import *
|
|
| 3 |
from excel_chat import *
|
| 4 |
from classification import *
|
| 5 |
from chart_generation import *
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
# def update_label(label1):
|
|
@@ -29,12 +30,25 @@ with gr.Blocks() as demo:
|
|
| 29 |
btn_classif = gr.Button("Categorize")
|
| 30 |
|
| 31 |
with gr.Tab("Charts Generation"):
|
| 32 |
-
gr.Markdown("## Deeper Analysis coming soon...")
|
| 33 |
with gr.Row():
|
| 34 |
dd_label1 = gr.Dropdown(label="Source Column", multiselect=False)
|
| 35 |
dd_label2 = gr.Dropdown(label="Source Column", multiselect=False)
|
| 36 |
btn_chart = gr.Button("Generate Bar Plot")
|
| 37 |
plt_figure = gr.Plot()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
with gr.Accordion("Excel Preview", open=False):
|
| 40 |
df_output = gr.DataFrame()
|
|
@@ -42,10 +56,20 @@ with gr.Blocks() as demo:
|
|
| 42 |
fi_excel = gr.File(label="Excel File")
|
| 43 |
|
| 44 |
fi_excel.change(get_columns, inputs=[fi_excel], outputs=[dd_source_ask, dd_source_class, dd_label1, dd_label2, df_output])
|
|
|
|
| 45 |
btn_extract.click(extractionPrincipale, inputs=[tb_url, fi_excel], outputs=[fi_excel, tb_status_message])
|
|
|
|
| 46 |
mist_button.click(chat_with_mistral, inputs=[dd_source_ask, tb_destcol, tb_prompt, tb_filename, fi_excel, tb_url], outputs=[fi_excel, df_output])
|
|
|
|
| 47 |
btn_classif.click(classification, inputs=[dd_source_class, fi_excel], outputs=[fi_excel, df_output])
|
|
|
|
| 48 |
btn_chart.click(create_bar_plot, inputs=[fi_excel, dd_label1, dd_label2], outputs=[plt_figure])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
# dd_label1.change(update_label, inputs=[dd_label1], outputs=[dd_label2])
|
| 50 |
|
| 51 |
|
|
|
|
| 3 |
from excel_chat import *
|
| 4 |
from classification import *
|
| 5 |
from chart_generation import *
|
| 6 |
+
from charts_advanced import *
|
| 7 |
|
| 8 |
|
| 9 |
# def update_label(label1):
|
|
|
|
| 30 |
btn_classif = gr.Button("Categorize")
|
| 31 |
|
| 32 |
with gr.Tab("Charts Generation"):
|
|
|
|
| 33 |
with gr.Row():
|
| 34 |
dd_label1 = gr.Dropdown(label="Source Column", multiselect=False)
|
| 35 |
dd_label2 = gr.Dropdown(label="Source Column", multiselect=False)
|
| 36 |
btn_chart = gr.Button("Generate Bar Plot")
|
| 37 |
plt_figure = gr.Plot()
|
| 38 |
+
|
| 39 |
+
with gr.Tab("Chart Generation"):
|
| 40 |
+
with gr.Tab("Overall"):
|
| 41 |
+
btn_overall = gr.Button("Overall Review")
|
| 42 |
+
with gr.Tab("By Expert"):
|
| 43 |
+
rd_exp=gr.Radio(["Satellite Networks / Nicolas", "Emergency Communication / Dorin", "Trend Analysis / Ly-Thanh", "Security Trust / Mireille", "Distributed Networks / Guillaume", "Network Security / Khawla", "USIM Management / Vincent", "Eco-Design / Pierre"], label="Expert Name")
|
| 44 |
+
btn_expert = gr.Button("Top 10 by expert")
|
| 45 |
+
with gr.Tab("By Company"):
|
| 46 |
+
tb_com=gr.Textbox(label="Company Name",info="You can write 1, 2 or 3 company names at the same time")
|
| 47 |
+
btn_type = gr.Button("Document type by company")
|
| 48 |
+
with gr.Row():
|
| 49 |
+
plt_chart = gr.Plot(label="Graphique")
|
| 50 |
+
plt_chart2 = gr.Plot(label="Graphique")
|
| 51 |
+
plt_chart3 = gr.Plot(label="Graphique")
|
| 52 |
|
| 53 |
with gr.Accordion("Excel Preview", open=False):
|
| 54 |
df_output = gr.DataFrame()
|
|
|
|
| 56 |
fi_excel = gr.File(label="Excel File")
|
| 57 |
|
| 58 |
fi_excel.change(get_columns, inputs=[fi_excel], outputs=[dd_source_ask, dd_source_class, dd_label1, dd_label2, df_output])
|
| 59 |
+
|
| 60 |
btn_extract.click(extractionPrincipale, inputs=[tb_url, fi_excel], outputs=[fi_excel, tb_status_message])
|
| 61 |
+
|
| 62 |
mist_button.click(chat_with_mistral, inputs=[dd_source_ask, tb_destcol, tb_prompt, tb_filename, fi_excel, tb_url], outputs=[fi_excel, df_output])
|
| 63 |
+
|
| 64 |
btn_classif.click(classification, inputs=[dd_source_class, fi_excel], outputs=[fi_excel, df_output])
|
| 65 |
+
|
| 66 |
btn_chart.click(create_bar_plot, inputs=[fi_excel, dd_label1, dd_label2], outputs=[plt_figure])
|
| 67 |
+
|
| 68 |
+
btn_overall.click(generate_company_chart,inputs=[fi_excel], outputs=[plt_chart])
|
| 69 |
+
btn_overall.click(status_chart,inputs=[fi_excel], outputs=[plt_chart2])
|
| 70 |
+
btn_overall.click(category_chart,inputs=[fi_excel], outputs=[plt_chart3])
|
| 71 |
+
btn_expert.click(chart_by_expert,inputs=[fi_excel,rd_exp], outputs=[plt_chart])
|
| 72 |
+
btn_type.click(company_document_type,inputs=[fi_excel,tb_com], outputs=[plt_chart])
|
| 73 |
# dd_label1.change(update_label, inputs=[dd_label1], outputs=[dd_label2])
|
| 74 |
|
| 75 |
|