Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -39,13 +39,13 @@ def predict(title, summary, tokenizer, model):
|
|
39 |
@st.cache(suppress_st_warning=True)
|
40 |
def get_results(prediction, prediction_probs):
|
41 |
frame = pd.DataFrame({'Topic': prediction, 'Confidence': prediction_probs})
|
42 |
-
return frame.reset_index(drop=True
|
43 |
|
44 |
label_to_theme = {0: 'Computer science', 1: 'Economics', 2: 'Electrical Engineering and Systems Science', 3: 'Math',
|
45 |
4: 'Quantitative biology', 5: 'Quantitative Finance', 6: 'Statistics', 7: 'Physics'}
|
46 |
|
47 |
-
st.title("Arxiv articles classification")
|
48 |
-
st.markdown("<img width=200px src='https://media.wired.com/photos/592700e3cfe0d93c474320f1/191:100/w_1200,h_630,c_limit/faces-icon.jpg'>", unsafe_allow_html=True)
|
49 |
st.markdown("This is an interface that can determine the article's topic based on its title and summary. Though it can work with title only, it is recommended that you provide summary if possible - this will result in a better prediction quality.")
|
50 |
|
51 |
tokenizer, model = load_model()
|
|
|
39 |
@st.cache(suppress_st_warning=True)
|
40 |
def get_results(prediction, prediction_probs):
|
41 |
frame = pd.DataFrame({'Topic': prediction, 'Confidence': prediction_probs})
|
42 |
+
return frame.reset_index(drop=True)
|
43 |
|
44 |
label_to_theme = {0: 'Computer science', 1: 'Economics', 2: 'Electrical Engineering and Systems Science', 3: 'Math',
|
45 |
4: 'Quantitative biology', 5: 'Quantitative Finance', 6: 'Statistics', 7: 'Physics'}
|
46 |
|
47 |
+
st.title("<h1 style='text-align: center;'>Arxiv articles classification")
|
48 |
+
st.markdown("<h1 style='text-align: center;'><img width=200px src='https://media.wired.com/photos/592700e3cfe0d93c474320f1/191:100/w_1200,h_630,c_limit/faces-icon.jpg'>", unsafe_allow_html=True)
|
49 |
st.markdown("This is an interface that can determine the article's topic based on its title and summary. Though it can work with title only, it is recommended that you provide summary if possible - this will result in a better prediction quality.")
|
50 |
|
51 |
tokenizer, model = load_model()
|