Spaces:
Paused
Paused
debatelab-admin
commited on
Commit
•
4677b12
1
Parent(s):
b5a6c06
Update app.
Browse files
app.py
CHANGED
@@ -427,37 +427,37 @@ def main():
|
|
427 |
graphviz_graph = get_inference_graph(argdown_parsed,colors) if argdown_valid else None
|
428 |
|
429 |
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
|
462 |
|
463 |
if __name__ == '__main__':
|
|
|
427 |
graphviz_graph = get_inference_graph(argdown_parsed,colors) if argdown_valid else None
|
428 |
|
429 |
|
430 |
+
# Show output
|
431 |
+
col_source, col_reco = st.columns(2)
|
432 |
+
with col_source:
|
433 |
+
st.markdown(f'<div style="font-size: small">Reasons and conclusions in source text</div>',unsafe_allow_html=True)
|
434 |
+
st.write(HTML_WRAPPER.format(displacy_html), unsafe_allow_html=True)
|
435 |
+
|
436 |
+
with col_reco:
|
437 |
+
ig_expander = st.expander(label='Argument reconstruction (inference graph)', expanded=argdown_valid)
|
438 |
+
with ig_expander:
|
439 |
+
if argdown_valid:
|
440 |
+
st.graphviz_chart(graphviz_graph,use_container_width=True)
|
441 |
+
else:
|
442 |
+
st.write("No inference graph to display.")
|
443 |
+
lgc_expander = st.expander(label='Formalization', expanded=(pform_valid and cform_valid))
|
444 |
+
with lgc_expander:
|
445 |
+
if pform_valid and cform_valid:
|
446 |
+
st.markdown(get_formalization_display(pform_parsed=pform_parsed, cform_parsed=cform_parsed))
|
447 |
+
else:
|
448 |
+
st.write("No formalization to display.")
|
449 |
+
ad_expander = st.expander(label='Argument reconstruction (argdown snippet)', expanded=(not argdown_valid))
|
450 |
+
with ad_expander:
|
451 |
+
st.write(format_argdown(argdown_raw,colors), unsafe_allow_html=True)
|
452 |
+
|
453 |
+
history_expander = st.expander(label='Full history', expanded=False)
|
454 |
+
with history_expander:
|
455 |
+
st.write(output)
|
456 |
+
|
457 |
+
#for out in output:
|
458 |
+
# st.write("step: %d, mode: %s" % (out['step'],out['mode']['id']))
|
459 |
+
# output_f = format_argdown(out['output']) if out['mode']['to']=='argdown_reconstruction' else out['output']
|
460 |
+
# st.write(output_f, unsafe_allow_html=True)
|
461 |
|
462 |
|
463 |
if __name__ == '__main__':
|