manish-aggarwal commited on
Commit
07be6f3
Β·
verified Β·
1 Parent(s): 5358272

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -40,9 +40,9 @@ def process_file(file):
40
  is_contract_flag, classification = is_contract(text)
41
  if is_contract_flag:
42
  parties = extract_parties(text)
43
- return "βœ… This is a contract.", parties
44
  else:
45
- return "❌ This is NOT a contract.", []
46
 
47
  # Gradio interface
48
  iface = gr.Interface(
@@ -50,7 +50,7 @@ iface = gr.Interface(
50
  inputs=gr.File(file_types=[".txt", ".pdf", ".docx"], label="Upload a document"),
51
  outputs=[
52
  gr.Textbox(label="Classification Result"),
53
- gr.Label(label="Detected Parties")
54
  ],
55
  title="Contract Classifier with RoBERTa",
56
  description="Upload a document (.pdf, .txt, .docx) to detect if it's a contract and extract involved parties using RoBERTa."
 
40
  is_contract_flag, classification = is_contract(text)
41
  if is_contract_flag:
42
  parties = extract_parties(text)
43
+ return "βœ… This is a contract.", ", ".join(parties)
44
  else:
45
+ return "❌ This is NOT a contract.", ""
46
 
47
  # Gradio interface
48
  iface = gr.Interface(
 
50
  inputs=gr.File(file_types=[".txt", ".pdf", ".docx"], label="Upload a document"),
51
  outputs=[
52
  gr.Textbox(label="Classification Result"),
53
+ gr.Textbox(label="Detected Parties (ORG/PER)")
54
  ],
55
  title="Contract Classifier with RoBERTa",
56
  description="Upload a document (.pdf, .txt, .docx) to detect if it's a contract and extract involved parties using RoBERTa."