File size: 860 Bytes
fd4a87f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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)