Update app.py
Browse files
app.py
CHANGED
|
@@ -27,7 +27,7 @@ def load_model():
|
|
| 27 |
|
| 28 |
def predict(title: str, abstract: str):
|
| 29 |
if not title.strip():
|
| 30 |
-
raise gr.Error("
|
| 31 |
|
| 32 |
load_model()
|
| 33 |
|
|
@@ -57,12 +57,12 @@ def predict(title: str, abstract: str):
|
|
| 57 |
demo = gr.Interface(
|
| 58 |
fn=predict,
|
| 59 |
inputs=[
|
| 60 |
-
gr.Textbox(label="Название статьи", placeholder="
|
| 61 |
-
gr.Textbox(label="Abstract
|
| 62 |
],
|
| 63 |
-
outputs=gr.Label(label="
|
| 64 |
-
title="
|
| 65 |
-
description="Введи название и
|
| 66 |
)
|
| 67 |
|
| 68 |
demo.launch()
|
|
|
|
| 27 |
|
| 28 |
def predict(title: str, abstract: str):
|
| 29 |
if not title.strip():
|
| 30 |
+
raise gr.Error("Нужен как минимум заголовок статьи, введите пожалуйста")
|
| 31 |
|
| 32 |
load_model()
|
| 33 |
|
|
|
|
| 57 |
demo = gr.Interface(
|
| 58 |
fn=predict,
|
| 59 |
inputs=[
|
| 60 |
+
gr.Textbox(label="Название статьи", placeholder="Заголовок статьи: "),
|
| 61 |
+
gr.Textbox(label="Abstract", placeholder="Abstract статьи: ", lines=5),
|
| 62 |
],
|
| 63 |
+
outputs=gr.Label(label="Вероятности классов топ 95%"),
|
| 64 |
+
title="Классификатор статей",
|
| 65 |
+
description="Введи название и abstract статьи, классификация тэга статьи из arxiv",
|
| 66 |
)
|
| 67 |
|
| 68 |
demo.launch()
|