Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -127,19 +127,21 @@ questions = load_questions()
|
|
127 |
contracts = load_contracts()
|
128 |
contract = contracts[0]
|
129 |
|
130 |
-
st.header("Question Answering in Contract Understanding Atticus Dataset (CUAD)")
|
131 |
st.image("contract_review.png")
|
|
|
132 |
selected_question = st.selectbox('Choose one of the queries from the CUAD dataset or write a legal contract and see if the model can answer correctly. The model only supports English Language:', questions)
|
|
|
133 |
question_set = [questions[0], selected_question]
|
134 |
contract_type = st.radio("Select Contract", ("Sample Contract", "New Contract"))
|
135 |
|
136 |
-
if contract_type == "Sample Contract":
|
137 |
sample_contract_num = st.slider("Select Sample Contract #")
|
138 |
contract = contracts[sample_contract_num]
|
139 |
with st.expander(f"Sample Contract #{sample_contract_num}"):
|
140 |
st.write(contract)
|
141 |
else:
|
142 |
-
contract = st.text_area("Input New Contract", "", height=256)
|
143 |
Run_Button = st.button("Run", key=None)
|
144 |
if Run_Button == True and not len(contract)==0 and not len(question_set)==0:
|
145 |
predictions = run_prediction(question_set, contract, 'akdeniz27/roberta-base-cuad')
|
@@ -148,7 +150,7 @@ if Run_Button == True and not len(contract)==0 and not len(question_set)==0:
|
|
148 |
if i != 0: st.write(f"Question: {question_set[int(p)]}\n\nAnswer: {predictions[p]}\n\n")
|
149 |
|
150 |
|
151 |
-
st.write("Credits")
|
152 |
st.write("Model: akdeniz27/roberta-base-cuad")
|
153 |
st.write("Project: https://www.atticusprojectai.org/cuad")
|
154 |
st.write("Git Hub: https://github.com/TheAtticusProject/cuad")
|
|
|
127 |
contracts = load_contracts()
|
128 |
contract = contracts[0]
|
129 |
|
130 |
+
st.header("π Question Answering in Contract Understanding Atticus Dataset (CUAD)")
|
131 |
st.image("contract_review.png")
|
132 |
+
|
133 |
selected_question = st.selectbox('Choose one of the queries from the CUAD dataset or write a legal contract and see if the model can answer correctly. The model only supports English Language:', questions)
|
134 |
+
|
135 |
question_set = [questions[0], selected_question]
|
136 |
contract_type = st.radio("Select Contract", ("Sample Contract", "New Contract"))
|
137 |
|
138 |
+
if contract_type == "π Sample Contract":
|
139 |
sample_contract_num = st.slider("Select Sample Contract #")
|
140 |
contract = contracts[sample_contract_num]
|
141 |
with st.expander(f"Sample Contract #{sample_contract_num}"):
|
142 |
st.write(contract)
|
143 |
else:
|
144 |
+
contract = st.text_area("π Input New Contract", "", height=256)
|
145 |
Run_Button = st.button("Run", key=None)
|
146 |
if Run_Button == True and not len(contract)==0 and not len(question_set)==0:
|
147 |
predictions = run_prediction(question_set, contract, 'akdeniz27/roberta-base-cuad')
|
|
|
150 |
if i != 0: st.write(f"Question: {question_set[int(p)]}\n\nAnswer: {predictions[p]}\n\n")
|
151 |
|
152 |
|
153 |
+
st.write("Credits: ")
|
154 |
st.write("Model: akdeniz27/roberta-base-cuad")
|
155 |
st.write("Project: https://www.atticusprojectai.org/cuad")
|
156 |
st.write("Git Hub: https://github.com/TheAtticusProject/cuad")
|