chatbot-model-bills / src /components /render_parameters.py
penguinsfly's picture
reorganize into component files, add info, and add pca plot
fd4a87f verified
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
)