VarshithaChennamsetti commited on
Commit
6fa7dfd
·
unverified ·
2 Parent(s): 627520f 5afdbc6

Merge pull request #5 from VarshithaChennamsetti/milestone-3

Browse files
Files changed (1) hide show
  1. patent_app.py +8 -4
patent_app.py CHANGED
@@ -39,16 +39,20 @@ val_set = val_set.filter(lambda e: e['decision'] <= 1)
39
  # Display all patent numbers to select a file
40
  patent_num = st.selectbox("Select a patent based on its number", val_set['patent_number'])
41
 
 
 
42
  # Get the abstract and claims data to predict
43
- if patent_num and st.button('Get Data to predict!'):
44
  # Display the abstract and claims
45
  val_set = val_set.filter(lambda e: e['patent_number'] == patent_num)
46
 
47
- abstract_text = st.text_area('Abstract', val_set['abstract'])
48
- claims_text = st.text_area('Abstract', val_set['claims'])
 
 
49
 
50
  # Predict on those texts
51
- if abstract_text and claims_text and st.button('Predict!'):
52
  # Model/tokenizer name or path to finetuned model
53
  model_name_or_path = './models/'
54
  model_name = 'distilbert-base-uncased'
 
39
  # Display all patent numbers to select a file
40
  patent_num = st.selectbox("Select a patent based on its number", val_set['patent_number'])
41
 
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'