Spaces:
Runtime error
Runtime error
VarshithaChennamsetti
commited on
Update patent_app.py
Browse files- patent_app.py +4 -2
patent_app.py
CHANGED
@@ -44,10 +44,12 @@ patent_num = st.selectbox("Select a patent based on its number", val_set['paten
|
|
44 |
if "button_clicked" not in st.session_state:
|
45 |
st.session_state.button_clicked = False
|
46 |
|
47 |
-
|
|
|
|
|
48 |
|
49 |
# Get the abstract and claims data to predict
|
50 |
-
if patent_num and (
|
51 |
# Display the abstract and claims
|
52 |
val_set = val_set.filter(lambda e: e['patent_number'] == patent_num)
|
53 |
|
|
|
44 |
if "button_clicked" not in st.session_state:
|
45 |
st.session_state.button_clicked = False
|
46 |
|
47 |
+
# The button was clicked
|
48 |
+
def callback():
|
49 |
+
st.session_state.button_clicked = True
|
50 |
|
51 |
# Get the abstract and claims data to predict
|
52 |
+
if patent_num and (st.button('Get Data to predict!', on_click = callback) or st.session_state.button_clicked):
|
53 |
# Display the abstract and claims
|
54 |
val_set = val_set.filter(lambda e: e['patent_number'] == patent_num)
|
55 |
|