eremeev-d commited on
Commit
6ed0d96
·
1 Parent(s): 2e865f8
Files changed (2) hide show
  1. app.py +25 -0
  2. core.py +11 -0
app.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import core
3
+
4
+ # TODO: add picture
5
+ st.set_page_config(
6
+ page_title="arXiv Seach",
7
+ layout="wide"
8
+ )
9
+
10
+ if 'last_query' not in st.session_state:
11
+ st.session_state['last_query'] = None
12
+
13
+
14
+ st.markdown("## arXiv Search")
15
+
16
+ with st.form("Search form"):
17
+ query = st.text_input("Enter a query")
18
+ clicked = st.form_submit_button("Search")
19
+
20
+
21
+ if clicked:
22
+ st.session_state['last_query'] = query
23
+
24
+ if st.session_state['last_query'] is not None:
25
+ core.display_answer(st.session_state['last_query'])
core.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import random
3
+
4
+
5
+ def display_answer(query):
6
+ st.write("---")
7
+ for doc_id in range(random.randint(3, 5)):
8
+ with st.container():
9
+ st.subheader("Paper #{}".format(doc_id))
10
+ st.markdown(r"Let's say it is description with LaTeX $\alpha$")
11
+ st.write("---")