rb757 commited on
Commit
c2519f2
·
1 Parent(s): 5176e8f

Add Streamlit app for patentability score prediction

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -62,3 +62,15 @@ if selected_patent:
62
  decision_labels = ['REJECTED', 'ACCEPTED', 'PENDING', 'CONT-REJECTED', 'CONT-ACCEPTED', 'CONT-PENDING']
63
  score = decision_labels[predictions.item()]
64
  st.write(f"Patentability Score: **{score}**")
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  decision_labels = ['REJECTED', 'ACCEPTED', 'PENDING', 'CONT-REJECTED', 'CONT-ACCEPTED', 'CONT-PENDING']
63
  score = decision_labels[predictions.item()]
64
  st.write(f"Patentability Score: **{score}**")
65
+
66
+ # Additional button to evaluate the model on the validation set
67
+ if st.button("Evaluate Model"):
68
+ eval_logits = []
69
+ for _, row in val_df.iterrows():
70
+ input_text = f"{row['abstract']} {row['claims']}"
71
+ inputs = tokenizer(input_text, return_tensors="pt", truncation=True, padding='max_length', max_length=512)
72
+ with torch.no_grad():
73
+ logits = model(**inputs).logits
74
+ eval_logits.append(logits)
75
+
76
+ st.write("Evaluation complete.")