Spaces:
Runtime error
Runtime error
File size: 1,374 Bytes
d8a4dbe e291f3a d8a4dbe 84a9829 ffa5ef6 8383c87 65aecd0 ffa5ef6 dc38e16 ada499d 95fff9b 9a40d74 3fca26d 13baf1d ada499d 13baf1d ada499d 13baf1d 5af806a 6526ed8 faf0e44 6526ed8 f47e438 6526ed8 5a030ba ada499d 13baf1d |
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 |
"""The following program will read in 2 XL sheets of KP matches and the user will evaluate the quality of the matching"""
import streamlit as st
import json
import pandas as pd
xl1 = st.file_uploader("Choose first file", key="xl1")
xl2 = st.file_uploader("Choose second file", key="xl2")
if xl1 is not None and xl2 is not None:
#assert that the first few columns are the same
df1 = pd.read_excel(xl1, sheet_name= "0.85 Threshold")
df2 = pd.read_excel(xl2, sheet_name= "0.85 Threshold")
st.write(df1[["Attendee A","Attendee B","KP"]])
if not df1[["Attendee A","Attendee B","KP"]].equals(df2[["Attendee A","Attendee B","KP"]]):
xl1 = None
xl2 = None
else:
i = 0
choices = []
st.write("First excel file")
for t1 in df1.iterrows():
r1 = t1[1]
kps1 = json.loads(r1["Matched KPs"].replace("'", '"'))
curr_keys = list(kps1.keys()).copy()
for kp1 in curr_keys:
if kps1[kp1] > 0.99:
kps1.pop(kp1)
#now display the kps
if kps1 == {}:
continue
else:
for kp1 in kps1.keys():
col1, col2, col3 = st.columns(3)
with col1:
st.write(r1["KP"])
with col2:
st.write(f"kp: {kp1}\ndistance: {kps1[kp1]}")
with col3:
choices.append(st.radio("Appropriate?", [True, False],key = i))
i+=1
|