VarshithaChennamsetti commited on
Commit
9370cde
·
unverified ·
2 Parent(s): 6fa7dfd 2a4bc1d

Merge pull request #6 from VarshithaChennamsetti/milestone-3

Browse files
Files changed (1) hide show
  1. patent_app.py +2 -4
patent_app.py CHANGED
@@ -42,17 +42,15 @@ patent_num = st.selectbox("Select a patent based on its number", val_set['paten
42
  button_1 = st.button('Get Data to predict!')
43
 
44
  # Get the abstract and claims data to predict
45
- if patent_num and button_1:
46
  # Display the abstract and claims
47
  val_set = val_set.filter(lambda e: e['patent_number'] == patent_num)
48
 
49
  abstract_text = st.text_area('Abstract', val_set['abstract'][0])
50
  claims_text = st.text_area('Claims', val_set['claims'][0])
51
 
52
- button_2 = st.button('Predict!')
53
-
54
  # Predict on those texts
55
- if abstract_text and claims_text and button_2:
56
  # Model/tokenizer name or path to finetuned model
57
  model_name_or_path = './models/'
58
  model_name = 'distilbert-base-uncased'
 
42
  button_1 = st.button('Get Data to predict!')
43
 
44
  # Get the abstract and claims data to predict
45
+ if patent_num and (button_1 | st.button('Predict!')):
46
  # Display the abstract and claims
47
  val_set = val_set.filter(lambda e: e['patent_number'] == patent_num)
48
 
49
  abstract_text = st.text_area('Abstract', val_set['abstract'][0])
50
  claims_text = st.text_area('Claims', val_set['claims'][0])
51
 
 
 
52
  # Predict on those texts
53
+ if abstract_text and claims_text and st.button('Predict!'):
54
  # Model/tokenizer name or path to finetuned model
55
  model_name_or_path = './models/'
56
  model_name = 'distilbert-base-uncased'