Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,14 +11,38 @@ ind_to_target = {ind: target for target, ind in target_to_ind.items()}
|
|
| 11 |
|
| 12 |
|
| 13 |
st.title('papers_classifier 🤓')
|
| 14 |
-
st.text("Hey! I'm papers_classifier and I'm here to help you with answering the question 'WTF is this paper about?\n'
|
| 15 |
-
According to arXiv there are 8 different fields of study - Computer Science, Economics, Electrical Engineering and Systems Science, Mathematics, Physics, Quantitative Biology, \
|
| 16 |
-
Quantitative Finance and Statistics. So, everything I'll tell you will be about these eight gentlemen.\n
|
| 17 |
-
You need to give me paper's title and (if you have one) it's abstract. Also you need to choose classification mode - there are 2 of them:
|
| 18 |
-
best prediction and top 95% which means that you'll see as many classes as I need to show you to be confident with probability at least 0.95 that the correct one is among them.\n
|
| 19 |
-
After that you need to press the Get prediction button and I'll tell you to which fields of study this paper is related. \n
|
| 20 |
-
")
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
@st.cache_resource
|
| 23 |
def load_model_and_tokenizer():
|
| 24 |
model_name = 'distilbert/distilbert-base-cased'
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
st.title('papers_classifier 🤓')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
@st.cache_data
|
| 16 |
+
def display_intro():
|
| 17 |
+
intro_text = """
|
| 18 |
+
Hey! I'm papers_classifier and I'm here to help you with answering the question 'WTF is this paper about?'
|
| 19 |
+
|
| 20 |
+
According to arXiv there are 8 different fields of study:
|
| 21 |
+
- Computer Science
|
| 22 |
+
- Economics
|
| 23 |
+
- Electrical Engineering and Systems Science
|
| 24 |
+
- Mathematics
|
| 25 |
+
- Physics
|
| 26 |
+
- Quantitative Biology
|
| 27 |
+
- Quantitative Finance
|
| 28 |
+
- Statistics
|
| 29 |
+
|
| 30 |
+
Everything I'll tell you will be about these eight fields.
|
| 31 |
+
|
| 32 |
+
How to use me:
|
| 33 |
+
1. Give me paper's title and (if you have one) it's abstract
|
| 34 |
+
2. Choose one of two classification modes:
|
| 35 |
+
- Best prediction: Shows the most likely to be true field
|
| 36 |
+
- Top 95%: Shows multiple fields until I'm at least 95% confident that the correct one is among them
|
| 37 |
+
3. Press the 'Get prediction' button
|
| 38 |
+
4. Wait for me to tell you which fields of study this paper relates to
|
| 39 |
+
"""
|
| 40 |
+
st.markdown(intro_text)
|
| 41 |
+
|
| 42 |
+
# Call the function to display the introduction
|
| 43 |
+
display_intro()
|
| 44 |
+
|
| 45 |
+
|
| 46 |
@st.cache_resource
|
| 47 |
def load_model_and_tokenizer():
|
| 48 |
model_name = 'distilbert/distilbert-base-cased'
|