Spaces:
Build error
Build error
Heiko Hotz
commited on
Commit
·
58555b2
1
Parent(s):
2639906
initial commit
Browse files
app.py
CHANGED
@@ -140,9 +140,13 @@ if st.button('Analyze'):
|
|
140 |
answer = predictions['0']
|
141 |
st.text_area(label="Answer", value=f"{answer}")
|
142 |
else:
|
|
|
143 |
with open("nbest.json") as jf:
|
144 |
data = json.load(jf)
|
145 |
-
|
|
|
|
|
|
|
146 |
st.success("Successfully processed contract!")
|
147 |
else:
|
148 |
st.write("Unable to call model, please select question and contract")
|
|
|
140 |
answer = predictions['0']
|
141 |
st.text_area(label="Answer", value=f"{answer}")
|
142 |
else:
|
143 |
+
answer = ""
|
144 |
with open("nbest.json") as jf:
|
145 |
data = json.load(jf)
|
146 |
+
for i in int(number_results):
|
147 |
+
answer += f"Answer {i+1}: {data['0'][i]['text']}\n"
|
148 |
+
answer += f"Probability: {data['0'][i]['probability']}\n\n"
|
149 |
+
st.success(answer)
|
150 |
st.success("Successfully processed contract!")
|
151 |
else:
|
152 |
st.write("Unable to call model, please select question and contract")
|