Commit
·
1bf15ed
1
Parent(s):
2caa6a6
Update app.py
Browse files
app.py
CHANGED
@@ -111,18 +111,22 @@ if name and model_name:
|
|
111 |
contents = result["content"]
|
112 |
|
113 |
label = qrels[str(qid)].get(str(result_id), 0)
|
|
|
114 |
if label == 3:
|
115 |
style = "style=\"color:rgb(231, 95, 43);\""
|
|
|
116 |
elif label == 2:
|
117 |
style = "style=\"color:rgb(238, 147, 49);\""
|
|
|
118 |
elif label == 1:
|
119 |
style = "style=\"color:rgb(241, 177, 118);\""
|
|
|
120 |
else:
|
121 |
style = "style=\"color:grey;\""
|
122 |
|
123 |
print(qid, result_id, label, style)
|
124 |
# output = f'<div class="row"> <b>Rank</b>: {i+1} | <b>Document ID</b>: {result_id} | <b>Score</b>:{result_score:.2f}</div>'
|
125 |
-
output = f'<div class="row" {style}> <b>Rank</b>: {i+1} | <b>Document ID</b>: {result_id}'
|
126 |
|
127 |
try:
|
128 |
st.write(output, unsafe_allow_html=True)
|
|
|
111 |
contents = result["content"]
|
112 |
|
113 |
label = qrels[str(qid)].get(str(result_id), 0)
|
114 |
+
label_text = "None"
|
115 |
if label == 3:
|
116 |
style = "style=\"color:rgb(231, 95, 43);\""
|
117 |
+
label_text = "High"
|
118 |
elif label == 2:
|
119 |
style = "style=\"color:rgb(238, 147, 49);\""
|
120 |
+
label_text = "Medium"
|
121 |
elif label == 1:
|
122 |
style = "style=\"color:rgb(241, 177, 118);\""
|
123 |
+
label_text = "Low"
|
124 |
else:
|
125 |
style = "style=\"color:grey;\""
|
126 |
|
127 |
print(qid, result_id, label, style)
|
128 |
# output = f'<div class="row"> <b>Rank</b>: {i+1} | <b>Document ID</b>: {result_id} | <b>Score</b>:{result_score:.2f}</div>'
|
129 |
+
output = f'<div class="row" {style}> <b>Rank</b>: {i+1} | <b>Document ID</b>: {result_id} | <b>True Relevance ID</b>: {label_text}'
|
130 |
|
131 |
try:
|
132 |
st.write(output, unsafe_allow_html=True)
|