ki33elev commited on
Commit
53b2971
1 Parent(s): fd871ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -39,12 +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.to_string(index=False)
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("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.")
49
 
50
  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, inplace=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()