Spaces:
Runtime error
Runtime error
Update results.py
Browse files- results.py +25 -30
results.py
CHANGED
|
@@ -125,47 +125,42 @@ fig.update_layout(
|
|
| 125 |
|
| 126 |
Perplexity_Across_Different_Buckets_global_graph = fig
|
| 127 |
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
# The data you provided
|
| 131 |
-
DATA = [
|
| 132 |
-
["2014", [["1-1", "2-5", "6-10", "11-100", "101-1000", "1001-30000000"], [17.410227605477868, 16.11176217183986, 15.632757662414805, 15.446116676532212, 16.716943171826703, 18.156821563322765]]],
|
| 133 |
-
["2015", [["1-1", "2-5", "6-10", "11-100", "101-1000", "1001-30000000"], [17.446573602753478, 16.14852530113782, 15.627408549576069, 15.0055028132117, 15.565430373421485, 17.314701050452452]]],
|
| 134 |
-
["2016", [["1-1", "2-5", "6-10", "11-100", "101-1000", "1001-30000000"], [17.307221780905284, 16.297702171159543, 15.948641884223639, 14.799690714225637, 14.935989931859659, 16.09585768919658]]],
|
| 135 |
-
["2017", [["1-1", "2-5", "6-10", "11-100", "101-1000", "1001-30000000"], [17.338525603992114, 15.960924352297502, 15.912187993988933, 14.822102470001267, 14.778913482337416, 15.428145290012955]]],
|
| 136 |
-
["2018", [["1-1", "2-5", "6-10", "11-100", "101-1000", "1001-30000000"], [17.08551151136689, 16.187802102106698, 14.935072408852303, 14.832038213200583, 14.508674264491997, 14.800605964649103]]],
|
| 137 |
-
["2019", [["1-1", "2-5", "6-10", "11-100", "101-1000", "1001-30000000"], [16.818363305107052, 16.474269837858706, 14.944741674400241, 14.568394784374943, 14.690158822673334, 15.990949424635108]]],
|
| 138 |
-
["2020", [["1-1", "2-5", "6-10", "11-100", "101-1000", "1001-30000000"], [16.98821894111693, 15.936494557783181, 14.79960386342691, 14.435682562274105, 14.58651834886038, 15.869365567783806]]],
|
| 139 |
-
["2021", [["1-1", "2-5", "6-10", "11-100", "101-1000", "1001-30000000"], [17.125795647512877, 15.780419457145868, 14.631430892394002, 14.276477514399625, 14.337146941773641, 15.872474774329305]]],
|
| 140 |
-
["2022", [["1-1", "2-5", "6-10", "11-100", "101-1000", "1001-30000000"], [16.573462144306383, 15.283018703313582, 14.378277745163881, 14.0611924390084, 13.9886330091318, 15.769421394877273]]],
|
| 141 |
-
["2023", [["1-1", "2-5", "6-10", "11-100", "101-1000", "1001-30000000"], [15.4293630385597, 14.608379914730168, 14.118271697056592, 13.880215644749589, 13.767106666731275, 15.05749135510839]]]
|
| 142 |
-
]
|
| 143 |
|
| 144 |
-
#
|
| 145 |
-
years = [
|
| 146 |
-
|
| 147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
|
| 149 |
-
# Create
|
| 150 |
fig = go.Figure()
|
| 151 |
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
fig.add_trace(go.Scatter(x=years, y=values, mode='lines+markers', name=range_label))
|
| 156 |
|
| 157 |
# Update layout
|
| 158 |
fig.update_layout(
|
| 159 |
-
title="Perplexity
|
| 160 |
xaxis_title="Year",
|
| 161 |
-
yaxis_title="Perplexity",
|
| 162 |
legend_title="Buckets",
|
| 163 |
hovermode="x unified"
|
| 164 |
)
|
| 165 |
|
| 166 |
-
# Show
|
| 167 |
-
|
| 168 |
-
Perplexity_Across_Different_years_graph = fig
|
| 169 |
|
| 170 |
#graph 3 tbd
|
| 171 |
|
|
@@ -794,7 +789,7 @@ perp1_div = Div(
|
|
| 794 |
H3("Perplexity vs Years"),
|
| 795 |
P("Taking the same data, we can convert it into a graph indicating the yearly trend. For most buckets, the average perplexity of dumps from more recent years seem to be lower than that of former years."),
|
| 796 |
Img(src="images/prep-across-diff-year-global-dup-buckets.png", height = "300", width = "600" ),
|
| 797 |
-
plotly2fasthtml(
|
| 798 |
),
|
| 799 |
Section(
|
| 800 |
H3("Perplexity vs Document Duplication"),
|
|
|
|
| 125 |
|
| 126 |
Perplexity_Across_Different_Buckets_global_graph = fig
|
| 127 |
|
| 128 |
+
##graph 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
|
| 130 |
+
# Data
|
| 131 |
+
years = ["2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023"]
|
| 132 |
+
buckets = ["1-1", "2-5", "6-10", "11-100", "101-1000", "1001-30000000"]
|
| 133 |
+
data = {
|
| 134 |
+
"2014": [17.410227605477868, 16.11176217183986, 15.632757662414805, 15.446116676532212, 16.716943171826703, 18.156821563322765],
|
| 135 |
+
"2015": [17.446573602753478, 16.14852530113782, 15.627408549576069, 15.0055028132117, 15.565430373421485, 17.314701050452452],
|
| 136 |
+
"2016": [17.307221780905284, 16.297702171159543, 15.948641884223639, 14.799690714225637, 14.935989931859659, 16.09585768919658],
|
| 137 |
+
"2017": [17.338525603992114, 15.960924352297502, 15.912187993988933, 14.822102470001267, 14.778913482337416, 15.428145290012955],
|
| 138 |
+
"2018": [17.08551151136689, 16.187802102106698, 14.935072408852303, 14.832038213200583, 14.508674264491997, 14.800605964649103],
|
| 139 |
+
"2019": [16.818363305107052, 16.474269837858706, 14.944741674400241, 14.568394784374943, 14.690158822673334, 15.990949424635108],
|
| 140 |
+
"2020": [16.98821894111693, 15.936494557783181, 14.79960386342691, 14.435682562274105, 14.58651834886038, 15.869365567783806],
|
| 141 |
+
"2021": [17.125795647512877, 15.780419457145868, 14.631430892394002, 14.276477514399625, 14.337146941773641, 15.872474774329305],
|
| 142 |
+
"2022": [16.573462144306383, 15.283018703313582, 14.378277745163881, 14.0611924390084, 13.9886330091318, 15.769421394877273],
|
| 143 |
+
"2023": [15.4293630385597, 14.608379914730168, 14.118271697056592, 13.880215644749589, 13.767106666731275, 15.05749135510839]
|
| 144 |
+
}
|
| 145 |
|
| 146 |
+
# Create a line plot for each bucket
|
| 147 |
fig = go.Figure()
|
| 148 |
|
| 149 |
+
for i, bucket in enumerate(buckets):
|
| 150 |
+
bucket_values = [data[year][i] for year in years]
|
| 151 |
+
fig.add_trace(go.Scatter(x=years, y=bucket_values, mode='lines+markers', name=bucket))
|
|
|
|
| 152 |
|
| 153 |
# Update layout
|
| 154 |
fig.update_layout(
|
| 155 |
+
title="Average Perplexity Over Years by Bucket",
|
| 156 |
xaxis_title="Year",
|
| 157 |
+
yaxis_title="Average Perplexity",
|
| 158 |
legend_title="Buckets",
|
| 159 |
hovermode="x unified"
|
| 160 |
)
|
| 161 |
|
| 162 |
+
# Show plot
|
| 163 |
+
graph2 = fig
|
|
|
|
| 164 |
|
| 165 |
#graph 3 tbd
|
| 166 |
|
|
|
|
| 789 |
H3("Perplexity vs Years"),
|
| 790 |
P("Taking the same data, we can convert it into a graph indicating the yearly trend. For most buckets, the average perplexity of dumps from more recent years seem to be lower than that of former years."),
|
| 791 |
Img(src="images/prep-across-diff-year-global-dup-buckets.png", height = "300", width = "600" ),
|
| 792 |
+
plotly2fasthtml(graph2),
|
| 793 |
),
|
| 794 |
Section(
|
| 795 |
H3("Perplexity vs Document Duplication"),
|