Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -39,13 +39,14 @@ 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 |
-
|
|
|
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("
|
48 |
-
st.markdown("<h1 style='text-align: center;'><img width=
|
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 |
+
frame.index = np.arange(1, len(frame))
|
43 |
+
return frame
|
44 |
|
45 |
label_to_theme = {0: 'Computer science', 1: 'Economics', 2: 'Electrical Engineering and Systems Science', 3: 'Math',
|
46 |
4: 'Quantitative biology', 5: 'Quantitative Finance', 6: 'Statistics', 7: 'Physics'}
|
47 |
|
48 |
+
st.title("Arxiv articles classification")
|
49 |
+
st.markdown("<h1 style='text-align: center;'><img width=300px src='https://media.wired.com/photos/592700e3cfe0d93c474320f1/191:100/w_1200,h_630,c_limit/faces-icon.jpg'>", unsafe_allow_html=True)
|
50 |
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.")
|
51 |
|
52 |
tokenizer, model = load_model()
|