Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,32 +1,24 @@
|
|
1 |
import gradio as gr
|
2 |
-
from modules.sentiment import sentiment_function # โมดูลวิเคราะห์ความรู้สึก
|
3 |
-
from modules.financial_analyst import financial_analysis_function # โมดูลวิเคราะห์การเงิน
|
4 |
-
from modules.translator import text_translator # โมดูลแปลภาษา
|
5 |
-
from modules.personal_info_identifier import identify_personal_info # โมดูลตรวจสอบข้อมูลส่วนบุคคล
|
6 |
-
from modules.churn_analysis import churn_prediction # โมดูลทำนายการเลิกบริการ
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
financial_result = financial_analysis_function(input_text)
|
11 |
-
translation_result = text_translator(input_text, "English")
|
12 |
-
personal_info_result = identify_personal_info(input_text)
|
13 |
-
churn_result = churn_prediction(input_text)
|
14 |
-
return sentiment_result, financial_result, translation_result, personal_info_result, churn_result
|
15 |
|
16 |
-
with gr.Blocks() as
|
17 |
-
gr.Markdown("#
|
18 |
-
gr.Markdown("### Combine various AI tasks into one platform")
|
19 |
|
20 |
-
|
|
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
translation_output = gr.Textbox(label="Translation Result")
|
25 |
-
personal_info_output = gr.Textbox(label="Personal Info Detection")
|
26 |
-
churn_output = gr.Textbox(label="Customer Churn Prediction")
|
27 |
|
28 |
-
|
|
|
29 |
|
30 |
-
|
|
|
31 |
|
32 |
-
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
+
# นำเข้าโมดูลแต่ละตัวจากโฟลเดอร์ modules
|
4 |
+
from modules import sentiment, financial_analyst, translator, personal_info_identifier, churn_analysis
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
+
with gr.Blocks(title="All-in-One AI App") as app:
|
7 |
+
gr.Markdown("# 🤖 All-in-One AI Utilities App")
|
|
|
8 |
|
9 |
+
with gr.Tab("🌍 Text Translator"):
|
10 |
+
translator.demo.render()
|
11 |
|
12 |
+
with gr.Tab("😊 Sentiment Analysis"):
|
13 |
+
sentiment.demo.render()
|
|
|
|
|
|
|
14 |
|
15 |
+
with gr.Tab("📊 Financial Analyst AI"):
|
16 |
+
financial_analyst.demo.render()
|
17 |
|
18 |
+
with gr.Tab("🔍 Personal Info Identifier"):
|
19 |
+
personal_info_identifier.demo.render()
|
20 |
|
21 |
+
with gr.Tab("📈 Customer Churn Prediction"):
|
22 |
+
churn_analysis.app.render()
|
23 |
+
|
24 |
+
app.launch()
|