lydianish commited on
Commit
9605440
·
verified ·
1 Parent(s): 786af16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -21
app.py CHANGED
@@ -107,27 +107,28 @@ def main():
107
  fig.update_yaxes(title_text='Cosine Distance')
108
  st.plotly_chart(fig, use_container_width=True)
109
 
110
- st.header('Cosine Distance Statistics')
111
- st.caption('*This box plot is interactive: Hover on the boxes to display values. Click on the legend items to filter models.*')
112
- fig = go.Figure()
113
- fig.add_trace(go.Box(
114
- y=outputs[outputs['model']=='LASER']['cos'],
115
- name='LASER',
116
- boxmean='sd'
117
- ))
118
- fig.add_trace(go.Box(
119
- y=outputs[outputs['model']=='RoLASER']['cos'],
120
- name='RoLASER',
121
- boxmean='sd'
122
- ))
123
- fig.add_trace(go.Box(
124
- y=outputs[outputs['model']=='c-RoLASER']['cos'],
125
- name='c-RoLASER',
126
- boxmean='sd'
127
- ))
128
- fig.update_xaxes(title_text='Model')
129
- fig.update_yaxes(title_text='Cosine Distance')
130
- st.plotly_chart(fig, use_container_width=True)
 
131
 
132
  if __name__ == "__main__":
133
  main()
 
107
  fig.update_yaxes(title_text='Cosine Distance')
108
  st.plotly_chart(fig, use_container_width=True)
109
 
110
+ if num_pairs > 1:
111
+ st.header('Cosine Distance Statistics')
112
+ st.caption('*This box plot is interactive: Hover on the boxes to display values. Click on the legend items to filter models.*')
113
+ fig = go.Figure()
114
+ fig.add_trace(go.Box(
115
+ y=outputs[outputs['model']=='LASER']['cos'],
116
+ name='LASER',
117
+ boxmean='sd'
118
+ ))
119
+ fig.add_trace(go.Box(
120
+ y=outputs[outputs['model']=='RoLASER']['cos'],
121
+ name='RoLASER',
122
+ boxmean='sd'
123
+ ))
124
+ fig.add_trace(go.Box(
125
+ y=outputs[outputs['model']=='c-RoLASER']['cos'],
126
+ name='c-RoLASER',
127
+ boxmean='sd'
128
+ ))
129
+ fig.update_xaxes(title_text='Model')
130
+ fig.update_yaxes(title_text='Cosine Distance')
131
+ st.plotly_chart(fig, use_container_width=True)
132
 
133
  if __name__ == "__main__":
134
  main()