File size: 1,699 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import streamlit as st

def render():
    with st.form("thresholds"):
        formthres_col1, formthres_col2, formthres_col3 = st.columns([1, 1, 1])
    
        formthres_col1.subheader('Thresholds per model sentence')
        min_nwords = formthres_col1.slider(
            'Min. number of words as a valid sentence', 
            min_value=5, max_value=20, value=10, step=1
        )
        thres_ratio = formthres_col1.slider(
            'Similarity threshold (partial fuzzy ratio)', 
            min_value=60, max_value=100, value=75, step=5
        )
        
        formthres_col2.subheader('Thresholds per bill')
        min_high_sim_num_sents = formthres_col2.slider(
            'Min. number of model sentences found in a bill', 
            min_value=5, max_value=20, value=10, step=1
        )
        min_high_sim_pct_sim = formthres_col2.slider(
            '(OR) Min. percentage of model sentences found in a bill',
            min_value=5, max_value=50, value=10, step=1
        )
    
        formthres_col3.subheader('Bill version to consider')
        version_to_count = formthres_col3.radio(
            'Choose setting',
            ['Latest version', 'Max. similar version'],
            captions=[
                'Only latest version of bill is considered for display and counting if the bill meets one of above thresholds',
                'All versions of bills are compared, only displaying/counting the max similar and most latest version' 
            ],
        )
    
        st.form_submit_button('Update analysis')

    return (
        min_nwords, 
        thres_ratio,
        min_high_sim_num_sents,
        min_high_sim_pct_sim,
        version_to_count
    )