Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
import torch
|
3 |
from transformers import DistilBertForSequenceClassification, DistilBertTokenizerFast
|
4 |
-
from utils import get_text,
|
5 |
|
6 |
count_labels = 8
|
7 |
|
@@ -20,7 +20,9 @@ model.load_state_dict(torch.load('weight_model'))
|
|
20 |
text = get_text(title, abstract)
|
21 |
if text:
|
22 |
raw_predictions = get_labels(text, model, tokenizer)
|
23 |
-
st.markdown(
|
|
|
|
|
24 |
else:
|
25 |
st.markdown("Ваш запрос пуст. Введите хотя бы название")
|
26 |
|
|
|
1 |
import streamlit as st
|
2 |
import torch
|
3 |
from transformers import DistilBertForSequenceClassification, DistilBertTokenizerFast
|
4 |
+
from utils import get_text, get_labels
|
5 |
|
6 |
count_labels = 8
|
7 |
|
|
|
20 |
text = get_text(title, abstract)
|
21 |
if text:
|
22 |
raw_predictions = get_labels(text, model, tokenizer)
|
23 |
+
st.markdown("Список классов к которым может относится данная статья")
|
24 |
+
for raw in raw_predictions:
|
25 |
+
st.markdown(f"{raw}")
|
26 |
else:
|
27 |
st.markdown("Ваш запрос пуст. Введите хотя бы название")
|
28 |
|