Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,12 +71,24 @@ def predict_kc(content_html: str):
|
|
| 71 |
label = predict_nb_count([text])[0]
|
| 72 |
return label
|
| 73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
interface = gr.Interface(
|
| 75 |
fn = predict_kc,
|
| 76 |
-
inputs = gr.Textbox(lines=
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
title = "KC Predictor",
|
| 79 |
-
description="Dự đoán nhãn KC dựa trên Naive Bayes."
|
|
|
|
|
|
|
|
|
|
| 80 |
)
|
| 81 |
|
| 82 |
if __name__ == "__main__":
|
|
|
|
| 71 |
label = predict_nb_count([text])[0]
|
| 72 |
return label
|
| 73 |
|
| 74 |
+
css = """
|
| 75 |
+
textarea { font-size: 18px !important; }
|
| 76 |
+
.gradio-container .output-text { font-size: 18px !important; }
|
| 77 |
+
"""
|
| 78 |
+
|
| 79 |
interface = gr.Interface(
|
| 80 |
fn = predict_kc,
|
| 81 |
+
inputs = gr.Textbox(lines=6,
|
| 82 |
+
placeholder="Dán nội dung câu hỏi dạng HTML",
|
| 83 |
+
label="Nội dung câu hỏi ",
|
| 84 |
+
elem_id="input-box"),
|
| 85 |
+
outputs = gr.Label(label="KC dự đoán",
|
| 86 |
+
elem_id="output-box"),
|
| 87 |
title = "KC Predictor",
|
| 88 |
+
description="Dự đoán nhãn KC dựa trên Naive Bayes.",
|
| 89 |
+
layout="vertical",
|
| 90 |
+
css=css,
|
| 91 |
+
allow_flagging="never"
|
| 92 |
)
|
| 93 |
|
| 94 |
if __name__ == "__main__":
|