Spaces:
Sleeping
Sleeping
Update my_model/tabs/results.py
Browse files- my_model/tabs/results.py +6 -6
my_model/tabs/results.py
CHANGED
@@ -49,14 +49,16 @@ class ResultDemonstrator(KBVQAEvaluator):
|
|
49 |
st.pyplot(fig)
|
50 |
|
51 |
############
|
52 |
-
|
53 |
# Load data from Excel
|
54 |
d = pd.read_excel('my_model/results/evaluation_results.xlsx', sheet_name="Main Data")
|
|
|
|
|
55 |
|
56 |
# Assume 'accuracies' and 'token_counts' need to be computed or are columns in the DataFrame
|
57 |
# Compute colors and labels for the plot (assuming these columns are already in the DataFrame)
|
58 |
-
d['color'] = d['
|
59 |
-
d['label'] = d['
|
60 |
|
61 |
# Creating the scatter plot
|
62 |
scatter_chart = alt.Chart(d).mark_circle(size=20).encode(
|
@@ -72,11 +74,9 @@ class ResultDemonstrator(KBVQAEvaluator):
|
|
72 |
|
73 |
####################
|
74 |
scores = d['vqa_score_13b_caption+detic']
|
75 |
-
token_counts = d['trimmed_tokens_count_caption_detic']
|
76 |
|
77 |
# Define colors and labels for the legend
|
78 |
-
|
79 |
-
labels = ['Correct' if score == 1 else 'Partially Correct' if score == 0.67 else 'Incorrect' for score in scores]
|
80 |
plt.figure(figsize=(10, 6))
|
81 |
# Create a scatter plot with smaller dots using the 's' parameter
|
82 |
scatter = plt.scatter(range(len(token_counts)), token_counts, c=colors, s=20, label=labels)
|
|
|
49 |
st.pyplot(fig)
|
50 |
|
51 |
############
|
52 |
+
|
53 |
# Load data from Excel
|
54 |
d = pd.read_excel('my_model/results/evaluation_results.xlsx', sheet_name="Main Data")
|
55 |
+
|
56 |
+
token_counts = d['trimmed_tokens_count_caption_detic']
|
57 |
|
58 |
# Assume 'accuracies' and 'token_counts' need to be computed or are columns in the DataFrame
|
59 |
# Compute colors and labels for the plot (assuming these columns are already in the DataFrame)
|
60 |
+
d['color'] = d['vqa_score_13b_caption+detic'].apply(lambda x: 'green' if x == 1 else 'orange' if round(x, 2) == 0.67 else 'red')
|
61 |
+
d['label'] = d['vqa_score_13b_caption+detic'].apply(lambda x: 'Correct' if x == 1 else 'Partially Correct' if x == 0.67 else 'Incorrect')
|
62 |
|
63 |
# Creating the scatter plot
|
64 |
scatter_chart = alt.Chart(d).mark_circle(size=20).encode(
|
|
|
74 |
|
75 |
####################
|
76 |
scores = d['vqa_score_13b_caption+detic']
|
|
|
77 |
|
78 |
# Define colors and labels for the legend
|
79 |
+
|
|
|
80 |
plt.figure(figsize=(10, 6))
|
81 |
# Create a scatter plot with smaller dots using the 's' parameter
|
82 |
scatter = plt.scatter(range(len(token_counts)), token_counts, c=colors, s=20, label=labels)
|