Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| from annotated_text import annotated_text | |
| def render(tab, model_bills, model_sent_df): | |
| tab.text( | |
| 'Note: These are counting all the bills in the data, not just bills that meet the per-bill thresholds. ' | |
| 'The spacing is a bit horrendus at the moment.' | |
| ) | |
| for model, mtab in zip( | |
| model_bills, tab.tabs(list(model_bills)) | |
| ): | |
| mtab.header(f'Model bill: {model}') | |
| for msec in ( | |
| model_sent_df.query('model == @model') | |
| .sort_values('section_idx') | |
| .to_dict('records') | |
| ): | |
| mtab.subheader('Annotated section: ' + msec['section_label']) | |
| with mtab: | |
| # annotated_text(*(msec['annotations'])) | |
| for _ms in msec['annotations']: | |
| annotated_text(_ms) | |