emvecchi commited on
Commit
68d3681
1 Parent(s): c43652c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -38,12 +38,12 @@ fields: List[Field] = [
38
  Field(name="comment", type="input_col", title="**Comment:**"),
39
  Field(name="image_name", type="input_col", title="**Visualization of high contributing properties:**"),
40
 
41
- #Field(type="container", title="", children=[
42
- # Field(name="reply_fitting", type="slider",
43
- # title="Is the reply comment **fitting and does it make sense** as a reply to the preceding comment?"),
44
- # Field(name="actions_clear", type="slider",
45
- # title="**Actions clarity**: Does the reply make it clear what actions need to be done?"),
46
- #]),
47
  #Field(type="expander",
48
  # title="Expand and fill-out this section if you see **issues in the original comment**",
49
  # children=[
@@ -105,13 +105,10 @@ def get_path():
105
  return f"{st.session_state.user_id}/{st.session_state.current_index}.json"
106
 
107
 
108
- #def display_image(image_path):
109
- # st.image(image_path, caption='Visualization of high contributing properties', use_column_width=True)
110
-
111
  def display_image(image_path):
112
  with hf_fs.open(image_path) as f:
113
  img = Image.open(f)
114
- st.image(img, caption='Visualization of high contributing properties', use_column_width=True)
115
 
116
  #################################### Streamlit App ####################################
117
 
@@ -156,9 +153,14 @@ def show_field(f: Field, index: int):
156
  st.session_state.data_inputs[f.name] = st.checkbox(f.title,
157
  key=key,
158
  value=value, help=f.help)
 
 
 
 
 
159
  case 'slider':
160
  st.session_state.data_inputs[f.name] = st.slider(f.title,
161
- min_value=0, max_value=100, step=25,
162
  key=key,
163
  value=value, help=f.help)
164
  case 'text':
 
38
  Field(name="comment", type="input_col", title="**Comment:**"),
39
  Field(name="image_name", type="input_col", title="**Visualization of high contributing properties:**"),
40
 
41
+ Field(type="container", title="", children=[
42
+ Field(name="to_moderate", type="radio",
43
+ title="**Moderator Intervention**: Do feel this comment/discussion would benefit from moderator intervention?"),
44
+ Field(name="actions_clear", type="slider",
45
+ title="**Priority**: With what level of priority would you need to interact with this comment?"),
46
+ ]),
47
  #Field(type="expander",
48
  # title="Expand and fill-out this section if you see **issues in the original comment**",
49
  # children=[
 
105
  return f"{st.session_state.user_id}/{st.session_state.current_index}.json"
106
 
107
 
 
 
 
108
  def display_image(image_path):
109
  with hf_fs.open(image_path) as f:
110
  img = Image.open(f)
111
+ st.image(img, caption='10 most contributing properties', use_column_width=True)
112
 
113
  #################################### Streamlit App ####################################
114
 
 
153
  st.session_state.data_inputs[f.name] = st.checkbox(f.title,
154
  key=key,
155
  value=value, help=f.help)
156
+ case 'radio':
157
+ st.session_state.data_inputs[f.name] = st.radio(f.title,
158
+ key=key,
159
+ options=['Yes', 'No', 'Other'],
160
+ value=value, help=f.help)
161
  case 'slider':
162
  st.session_state.data_inputs[f.name] = st.slider(f.title,
163
+ min_value=1, max_value=7, step=1,
164
  key=key,
165
  value=value, help=f.help)
166
  case 'text':