Spaces:
Runtime error
Runtime error
Commit
·
fd97dee
1
Parent(s):
dfc2950
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,14 +28,17 @@ _patent_id = st.selectbox(
|
|
| 28 |
dataset_dict["train"]["patent_number"],
|
| 29 |
)
|
| 30 |
|
| 31 |
-
|
|
|
|
|
|
|
| 32 |
# get abstract and claim corresponding to this patent id
|
| 33 |
_abstract = dataset_dict["train"][["patent_number"] == _patent_id]["abstract"]
|
| 34 |
_claim = dataset_dict["train"][["patent_number"] == _patent_id]["claims"]
|
|
|
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
|
| 40 |
# when submit button clicked, run the model and get result
|
| 41 |
if st.button("Submit"):
|
|
|
|
| 28 |
dataset_dict["train"]["patent_number"],
|
| 29 |
)
|
| 30 |
|
| 31 |
+
# display abstract and claim
|
| 32 |
+
@st.cache(persist=True)
|
| 33 |
+
def get_abs_claim(_patent_id):
|
| 34 |
# get abstract and claim corresponding to this patent id
|
| 35 |
_abstract = dataset_dict["train"][["patent_number"] == _patent_id]["abstract"]
|
| 36 |
_claim = dataset_dict["train"][["patent_number"] == _patent_id]["claims"]
|
| 37 |
+
return _abstract,_claim
|
| 38 |
|
| 39 |
+
_abstract,_claim = get_abs_claim(_patent_id)
|
| 40 |
+
st.write(_abstract)
|
| 41 |
+
st.write(_claim)
|
| 42 |
|
| 43 |
# when submit button clicked, run the model and get result
|
| 44 |
if st.button("Submit"):
|