muhtasham commited on
Commit
f3b05ad
1 Parent(s): df83b5c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -15,10 +15,6 @@ import time
15
  from torch.utils.data import DataLoader, RandomSampler, SequentialSampler
16
 
17
  model_checkpoint = "akdeniz27/roberta-base-cuad"
18
- st.sidebar.write("Model: akdeniz27/roberta-base-cuad")
19
- st.sidebar.write("Project: https://www.atticusprojectai.org/cuad")
20
- st.sidebar.write("Git Hub: https://github.com/TheAtticusProject/cuad")
21
- st.sidebar.write("CUAD Dataset: https://huggingface.co/datasets/cuad")
22
 
23
  @st.cache(allow_output_mutation=True)
24
  def run_prediction(question_texts, context_text, model_path):
@@ -131,10 +127,9 @@ questions = load_questions()
131
  contracts = load_contracts()
132
  contract = contracts[0]
133
 
134
- st.header("Contract Understanding Atticus Dataset (CUAD) Demo")
135
- st.write("Based on https://github.com/marshmellow77/cuad-demo")
136
 
137
- selected_question = st.selectbox('Choose one of the 41 queries from the CUAD dataset:', questions)
138
  question_set = [questions[0], selected_question]
139
  contract_type = st.radio("Select Contract", ("Sample Contract", "New Contract"))
140
 
@@ -151,3 +146,10 @@ if Run_Button == True and not len(contract)==0 and not len(question_set)==0:
151
 
152
  for i, p in enumerate(predictions):
153
  if i != 0: st.write(f"Question: {question_set[int(p)]}\n\nAnswer: {predictions[p]}\n\n")
 
 
 
 
 
 
 
 
15
  from torch.utils.data import DataLoader, RandomSampler, SequentialSampler
16
 
17
  model_checkpoint = "akdeniz27/roberta-base-cuad"
 
 
 
 
18
 
19
  @st.cache(allow_output_mutation=True)
20
  def run_prediction(question_texts, context_text, model_path):
 
127
  contracts = load_contracts()
128
  contract = contracts[0]
129
 
130
+ st.header("Question Answering in CUAD (Contract Understanding Atticus Dataset)")
 
131
 
132
+ selected_question = st.selectbox('Choose one of the queries from the CUAD dataset:', questions)
133
  question_set = [questions[0], selected_question]
134
  contract_type = st.radio("Select Contract", ("Sample Contract", "New Contract"))
135
 
 
146
 
147
  for i, p in enumerate(predictions):
148
  if i != 0: st.write(f"Question: {question_set[int(p)]}\n\nAnswer: {predictions[p]}\n\n")
149
+
150
+
151
+ st.write("Model: akdeniz27/roberta-base-cuad")
152
+ st.write("Project: https://www.atticusprojectai.org/cuad")
153
+ st.write("Git Hub: https://github.com/TheAtticusProject/cuad")
154
+ st.write("CUAD Dataset: https://huggingface.co/datasets/cuad")
155
+ st.write("Based on https://github.com/marshmellow77/cuad-demo")