Spaces:
Sleeping
Sleeping
Update app.py
Browse files23 unmodified lines2425262728293031323334353637383940414223 unmodified lines# create a new column for the scoredata["score"] = data[METRICS[0].lower()] * 0.0for i, metric in enumerate(METRICS):data["score"] += data[metric.lower()] * metric_weights[i]data = data.sort_values(by="score", ascending=False)data["ranking"] = range(1, len(data) + 1)# formattingdata["method"] = "[" + data["method"] + "](" + data["method_reference"] + ")"data["verified"] = data["verified"].apply(lambda x: "✅" if x else "")data = data.drop(columns=["method_reference", "dataset", "ipc"])data = data[['ranking', 'method', 'verified', 'date', 'label_type', 'hlr', 'ior', 'score']]if label_type == "Hard Label":data = data.rename(columns={"ranking": "Ranking", "method": "Method", "date": "Date", "label_type": "Label Type", "hlr": "HLR↓", "ior": "IOR↑", "score": "Score", "verified": "Verified"})else:data = data.rename(columns={"ranking": "Ranking", "method": "Method", "date": "Date", "label_type": "Label Type", "hlr": "HLR↓", "ior": "IOR↑", "score": "Score", "verified": "Verified"})return data23 unmodified lines242526272829303132333435363738394041424344454623 unmodified lines# create a new column for the scoredata["score"] = data[METRICS[0].lower()] * 0.0for i, metric in enumerate(METRICS):data["score"] += data[metric.lower()] * metric_weights[i] * METRICS_SIGN[i]data = data.sort_values(by="score", ascending=False)data["ranking"] = range(1, len(data) + 1)for metric in METRICS:data[metric.lower()] = data[metric.lower()].apply(lambda x: round(x, 2))data["score"] = data["score"].apply(lambda x: round(x, 2))# formattingdata["method"] = "[" + data["method"] + "](" + data["method_reference"] + ")"data["verified"] = data["verified"].apply(lambda x: "✅" if x else "")data = data.drop(columns=["method_reference", "dataset", "ipc"])data = data[['ranking', 'method', 'verified', 'date', 'label_type', 'hlr', 'ior', 'score']]if label_type == "Hard Label":data = data.rename(columns={"ranking": "Ranking", "method": "Method", "date": "Date", "label_type": "Label Type", "hlr": "HLR↓", "ior": "IOR↑", "score": "Score↓", "verified": "Verified"})else:data = data.rename(columns={"ranking": "Ranking", "method": "Method", "date": "Date", "label_type": "Label Type", "hlr": "HLR↓", "ior": "IOR↑", "score": "Score↓", "verified": "Verified"})return data
app.py+7-3