victormiller commited on
Commit
b3c41a8
1 Parent(s): 7dc3d5b

Update results.py

Browse files
Files changed (1) hide show
  1. results.py +108 -0
results.py CHANGED
@@ -235,6 +235,113 @@ fig.update_layout(
235
  # Show figure
236
  graph5 = fig
237
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
 
239
  intro_div = Div(
240
  H2("Perplexity Evaluation on Duplicate Data"),
@@ -280,6 +387,7 @@ perp1_div = Div(
280
  H3("Perplexity vs Local Dump Duplication"),
281
  P("Following the same practice, we can plot the local version of the graph of average perplexity with respect to dump duplication."),
282
  Img(src="images/prep-diff-dump-dump-counts-local.png", height = "300", width = "600" ),
 
283
  ),
284
  )
285
 
 
235
  # Show figure
236
  graph5 = fig
237
 
238
+ #graph 6
239
+
240
+ import plotly.graph_objects as go
241
+
242
+ # Data
243
+ data = {
244
+ "2014": {
245
+ "x": list(range(1, 88)),
246
+ "y": [16.82572561037536, 15.5729544573954, 15.76916326514348, 15.186302038671778, 14.936809838870326,
247
+ 15.001743417469209, 14.864349796797914, 14.66090559477578, 14.50521188055062, 14.429989457983405,
248
+ 14.44107090883399, 14.523867649934015, 14.515728033558386, 14.52893012438083, 14.3872701582485,
249
+ 14.225935934612775, 14.161270385625249, 14.193552536884559, 14.107559093534066, 14.045872060793387,
250
+ 13.98606116940174, 13.996535021107574, 14.068451357323962, 14.095424742580935, 14.104930415857556,
251
+ 14.164512298046297, 14.205441475464172, 14.190478352923273, 14.080583365838212, 14.017757335246573,
252
+ 13.914391577020234, 13.860680803527211, 13.709718483172745, 13.671102868173037, 13.641967377585344,
253
+ 13.610477152664181, 13.589404166531697, 13.574364349432603, 13.588675304139612, 13.608431855502594,
254
+ 13.602022539289871, 13.577550630742646, 13.5388901112764, 13.586266218232485, 13.543364159175262,
255
+ 13.530598188250648, 13.5415846166861, 13.518331785106323, 13.533012163841759, 13.505063315507076,
256
+ 13.546433152010087, 13.571041150558058, 13.538517630502037, 13.589716598763259, 13.542375131110317,
257
+ 13.551229472032986, 13.577615792486487, 13.580265758570304, 13.611791663131656, 13.563252675321158,
258
+ 13.496554744217198, 13.573611486889268, 13.619417346323402, 13.500110681053787, 13.606494277444822,
259
+ 13.51758492586705, 13.509290876196683, 13.637653184648098, 13.453927168439604, 13.677712744726351,
260
+ 13.586150504785195, 13.508649309624724, 13.427111951862848, 13.800940000499685, 13.540635679680195,
261
+ 13.506572883300588, 13.723957125925423, 13.69941910754067, 13.830916622405972, 13.61477646698581,
262
+ 14.050670659742897, 13.707871486489617, 13.879222794014064, 13.838270894748867, 14.189041030733511,
263
+ 14.221410654489386, 14.830844952562549]
264
+ },
265
+ "2015": {
266
+ "x": list(range(1, 88)),
267
+ "y": [16.89591942700286, 15.993069023056673, 16.243349252734195, 16.110419584106467, 15.982982023217136,
268
+ 15.780412452462956, 15.311492684065183, 14.985452841100962, 14.736003632647204, 14.643740634573437,
269
+ 14.581818722981641, 14.61206887509358, 14.60310477647637, 14.58283877743656, 14.456739625003323,
270
+ 14.371166857791525, 14.31983561927552, 14.324744175103753, 14.230377570291408, 14.172400195643684,
271
+ 14.074979303784101, 14.06637978929149, 14.129765267158923, 14.144182701579643, 14.127393749297303,
272
+ 14.170954937339665, 14.198905272060887, 14.177619224859075, 14.073073703918407, 14.014468948454157,
273
+ 13.91281662387792, 13.866047771993978, 13.718029097387152, 13.680243640703553, 13.648583428855366,
274
+ 13.620824659009545, 13.599252706541842, 13.582576892167687, 13.59570512552313, 13.620006512175056,
275
+ 13.61371460828329, 13.58747315850088, 13.553159834309662, 13.595855683037627, 13.555194351409998,
276
+ 13.545131292437988, 13.55533031134806, 13.53176578053929, 13.545627399503374, 13.52324264159441,
277
+ 13.56019390924936, 13.584765148382376, 13.567436274268637, 13.613633832001781, 13.56834903785532,
278
+ 13.564886395063189, 13.585588042180726, 13.59211972866627, 13.636661940057897, 13.583630103422175,
279
+ 13.517621040928827, 13.621723155241801, 13.644527863238189, 13.52150990576411, 13.63020958334669,
280
+ 13.54428783928786, 13.53725206048877, 13.647484409192606, 13.490519893023992, 13.683557383784123,
281
+ 13.623112173204985, 13.558759376238477, 13.498783050518579, 13.848023903419993, 13.565373956282203,
282
+ 13.524041036650617, 13.747948319462374, 13.741843984167335, 13.851135619804712, 13.592769333513887,
283
+ 14.059753132138649, 13.714031759165366, 13.87123035917049, 13.863386012094978, 14.205561271109257,
284
+ 14.22054632648026, 14.830844952562549]
285
+ },
286
+ "2016": {
287
+ "x": list(range(1, 88)),
288
+ "y": [16.937063110995666, 16.13008897039131, 16.461262248281052, 16.22524701869722, 16.07512945589454, 15.81169518738005, 15.401255747943388, 15.290536877276061, 15.189318784104037, 14.892680148096144, 14.874941231589043, 15.197590171491255, 14.874108876718813, 14.772934695761471, 14.717224961147101, 14.579633089306332, 14.50655782645537, 14.435927961362305, 14.348044387963261, 14.266921166623963, 14.175146176030633, 14.155440421923364, 14.193605317227636, 14.198019720781069, 14.163648287310021, 14.204946332399512, 14.22475496545738, 14.204790263028082, 14.093780256147781, 14.034401436018054, 13.932675009733511, 13.882052276281941, 13.74135284070189, 13.70495830877455, 13.67945861250605, 13.646286996486673, 13.62871684949669, 13.617194154766194, 13.625737566495989, 13.647397208854517, 13.644435990272989, 13.61908161116556, 13.579719730143186, 13.62432154955091, 13.586802920088218, 13.575059311720242, 13.583160915709527, 13.560181345211744, 13.568315314106055, 13.572213203030019, 13.592269857254504, 13.615523084934742, 13.59675061839986, 13.652762841246345, 13.605972800137922, 13.599797687151108, 13.61588443406148, 13.635017100727426, 13.67797680326676, 13.61550407767841, 13.549525029810649, 13.646426348264216, 13.685855644417883, 13.557730732623456, 13.654494917893674, 13.598966492740331, 13.596850824269557, 13.67606211623268, 13.531829321066132, 13.736041595486006, 13.66155540112554, 13.622341728732476, 13.576672515819212, 13.865689693447742, 13.593823653503895, 13.549026603238106, 13.757031791888123, 13.764537976595522, 13.887154797262793, 13.612757682949674, 14.062295065487943, 13.702773103249053, 13.887824206090368, 13.868971352456365, 14.206954791830077, 14.23126212995893, 14.830844952562549],
289
+ },
290
+ "2017": {
291
+ "x": list(range(1, 88)),
292
+ "y": [16.731010662045737, 16.66489684871436, 16.568296606954515, 16.437855314705402, 15.977926296110395, 15.325063337637374, 14.928282696800443, 14.738959466164316, 14.615199372327732, 14.491701731769748, 14.38837234689295, 14.579509085357541, 14.486096782010588, 14.386514742964506, 14.328783257345318, 14.247944995447972, 14.19065895107961, 14.17354382678591, 14.151039883117742, 14.102188877847754, 14.076004337973803, 14.044354444990084, 14.021645356806046, 14.030621721602873, 14.020477810045843, 14.031701258052667, 14.04171400712978, 14.043074023094446, 13.995387210524175, 13.989640260692584, 13.926046401793304, 13.898066232753337, 13.796470656270547, 13.780012350603617, 13.751151287426516, 13.721059118625764, 13.704432047525122, 13.69302750426319, 13.691196863860615, 13.720022791468368, 13.713297481354758, 13.673499420782665, 13.640347860637759, 13.689388371843485, 13.642074890212623, 13.641953443289871, 13.639384501232673, 13.60468612819505, 13.615030447011026, 13.622517997479935, 13.636776517056651, 13.646713543499644, 13.642553869063399, 13.670086160771016, 13.629072087229995, 13.644023633211804, 13.662921343294622, 13.663979848619121, 13.72041962705924, 13.653883587863746, 13.598487708047587, 13.679216506372514, 13.729500926935524, 13.59184630155257, 13.670119193506638, 13.606578039356629, 13.58912160797548, 13.662329284657567, 13.534494438724048, 13.673846450840824, 13.63996498360781, 13.62694917771645, 13.569375400530905, 13.86109411358942, 13.573009950696505, 13.521398904176095, 13.737765136250907, 13.73947064730135, 13.851957566097216, 13.591944403455463, 14.047275913134344, 13.706497861963147, 13.8752419700006, 13.852410962776265, 14.207173465915606, 14.225732066062445, 14.830844952562549],
293
+ },
294
+ "2018": {
295
+ "x": list(range(1, 88)),
296
+ "y": [16.36546565307699, 16.45401827941957, 16.3552192563823, 16.073789764186234, 15.71971918795885, 15.261114192297178, 14.951234486665056, 14.689367076535861, 14.518128318670973, 14.390099476525092, 14.259121880707934, 14.322341013577667, 14.269149775349785, 14.22657504335791, 14.17831063712821, 14.129362751026134, 14.091233660298563, 14.065699851355896, 14.045897986269743, 14.009922933506038, 14.008946008943926, 13.986948087868985, 13.96676299568112, 13.974589147811011, 13.981182540647008, 13.988178680995725, 14.022037638217835, 14.067236496270958, 14.02773875655739, 14.008012013219155, 13.96047327707988, 13.941545910212922, 13.874283503971592, 13.872319571354534, 13.848819496944696, 13.818989807687052, 13.795278583261243, 13.805582941066566, 13.77608884517368, 13.808300541084458, 13.801215406173135, 13.77460925841957, 13.749962347541663, 13.788585819175475, 13.738353323889454, 13.748267848539136, 13.743909070082335, 13.70094253905992, 13.695566142077064, 13.715120021384273, 13.717879111446795, 13.729262136679193, 13.722322759559463, 13.741817617080867, 13.695797507509411, 13.7303223115229, 13.721142524694981, 13.731183807899438, 13.774251666658795, 13.703270226348065, 13.650013779539329, 13.737063911330598, 13.771299601507252, 13.61035413656345, 13.692911759706188, 13.645478213049078, 13.632427440948039, 13.685353855181187, 13.536951397436473, 13.722996576069109, 13.684668668827719, 13.654991978676541, 13.571293959475197, 13.901327051067131, 13.590409846183357, 13.555280671785631, 13.801358266402337, 13.759891436212222, 13.877447278904341, 13.601070277589484, 14.053793686670241, 13.74239252938787, 13.856380061979658, 13.86653563573893, 14.207967017152274, 14.2295264543635, 14.830844952562549],
297
+ },
298
+ "2019": {
299
+ "x": list(range(1, 88)),
300
+ "y": [16.430122616908218, 16.875051086326838, 17.248145032061572, 16.40581365808372, 15.774430714575988, 15.432767149001718, 15.145763219926579, 14.799558762994192, 14.497109888060386, 14.314004689580893, 14.165230875628717, 14.132599998200735, 14.112646717547443, 14.08981745552461, 14.071275351524006, 14.055953745980803, 14.036895611705631, 14.010822458772108, 13.994688510028434, 13.981568297524671, 13.973131490690857, 13.960851307613188, 13.950407299676206, 13.957766631077842, 13.963923860192619, 13.94968503524683, 13.95489134897448, 13.977622152992309, 13.976393846039631, 13.993956516762394, 13.953670292574621, 13.955101324894523, 13.921696126960061, 13.922513268517232, 13.904228567859588, 13.878944392338122, 13.836936389689685, 13.858488953034747, 13.826255387319108, 13.821733497321453, 13.810924551284534, 13.788436757401502, 13.768651883781944, 13.803381095808694, 13.749861429185598, 13.766023951467982, 13.755033569040371, 13.733275547786105, 13.72346431637034, 13.742887974648536, 13.737327971523658, 13.755247742270127, 13.742754785888708, 13.774345891745789, 13.728724104358966, 13.745302135799491, 13.734638471314582, 13.7609514564792, 13.779567132297817, 13.70364460650017, 13.66329614928825, 13.77103900712268, 13.794109949823657, 13.621080526861675, 13.685285026135551, 13.645675824035878, 13.640254544445797, 13.696632265084162, 13.557089062423215, 13.72744068935533, 13.685312250371716, 13.691487365024885, 13.609612243178898, 13.871590990738959, 13.602896495117179, 13.545298074232608, 13.754105324744064, 13.784568829720575, 13.848250131622855, 13.601751414645124, 13.999031818997702, 13.692806805453536, 13.82245603247244, 13.856124808569652, 14.187925457414872, 14.223944149123374, 14.830844952562549]], [0.10806100217864933, 0.4148148148148145, 0.6274509803921567],
301
+ },
302
+ "2020": {
303
+ "x": list(range(1, 88)),
304
+ "y": [16.370879996210345, 15.889055037950405, 15.432190412594073, 15.505691782112706, 15.423788890368417, 15.240064903157505, 15.043391085766707, 14.761714938396674, 14.47962007552951, 14.234133021817758, 14.123336425923434, 14.080419066871459, 14.063393745363433, 14.051331002053393, 14.037897577554489, 14.041538161067855, 14.0145622985008, 13.995935362579743, 13.991791105247946, 13.983842732394558, 13.977020615720546, 13.966291155429351, 13.953143025987027, 13.969577694685832, 13.972274556692618, 13.967416689282992, 13.962867288546066, 13.983570820646507, 13.983105305183239, 14.007290834079699, 13.960017748248399, 13.97014807600787, 13.939131974855112, 13.931242142373641, 13.923784747364268, 13.884450633737517, 13.857702881178751, 13.86969533995838, 13.829427121984313, 13.834994065394055, 13.821808671828476, 13.790151002027123, 13.76907986225701, 13.797444154897008, 13.749256987787135, 13.766070221096518, 13.759434645334379, 13.731706353193822, 13.733304557490518, 13.740468199068971, 13.721036580994003, 13.756529386584269, 13.732150648873972, 13.763427764616013, 13.73375582951499, 13.719098308155836, 13.749579407257558, 13.79960240262951, 13.827660100575278, 13.713867309731741, 13.67110069190749, 13.813210464397173, 13.820210906230622, 13.646742569819427, 13.707821135028649, 13.694993324955234, 13.667868455414132, 13.744045961641467, 13.60673607296966, 13.735891876117867, 13.708771958501817, 13.68966975607113, 13.632689223663043, 13.935886970943438, 13.636130655693483, 13.612174548563797, 13.772534936472159, 13.807161877232101, 13.85457230058511, 13.663896751660037, 14.090271528268559, 13.73950346577504, 13.889399028025398, 13.875344815512134, 14.21697484183684, 14.23511142666353, 14.830844952562549]], [0.08104575163398697, 0.31111111111111095, 0.47058823529411764],
305
+ },
306
+ "2021": {
307
+ "x": list(range(1, 88)),
308
+ "y": [16.40998076014569, 16.131563389687667, 15.926483480935136, 15.698720075567504, 15.493215409831992, 15.18004517433272, 14.889295559356292, 14.61434191320944, 14.373082577547928, 14.186230894539502, 14.090058332837668, 14.023657754832897, 14.007435410828263, 13.98510741208859, 13.970141824822582, 13.969314479688267, 13.946015227855732, 13.928771902280433, 13.918094740825536, 13.904271041635251, 13.898094980435907, 13.884683163944276, 13.877957828236978, 13.901423741421022, 13.906131144086045, 13.902626593900637, 13.894640462593705, 13.918502460807465, 13.918292173412722, 13.936267540996683, 13.893769797887094, 13.89937529564544, 13.863770002450618, 13.867997609697417, 13.848933342732614, 13.815022252718682, 13.791564536076104, 13.785299092567266, 13.757852960538305, 13.756401654592215, 13.759718968653816, 13.733437497507486, 13.700263326582155, 13.741373305941403, 13.675414218993899, 13.706510616734628, 13.679167854117077, 13.691416726739856, 13.672658642514545, 13.70674777789251, 13.677889859468195, 13.696385833947582, 13.676118387776745, 13.712359839755743, 13.678461938862087, 13.655240869170136, 13.686341276950634, 13.718978062873198, 13.727316226517866, 13.656066612805246, 13.613789363715679, 13.743623408755314, 13.736977834220136, 13.602716719881093, 13.663563667635234, 13.62881219522605, 13.642571996285401, 13.684891127715069, 13.552729633336378, 13.722320681269425, 13.688784634409584, 13.681265629893907, 13.655688148500278, 13.889373816531247, 13.612825342345905, 13.606765349789637, 13.795350032043327, 13.82650292060858, 13.841286651582926, 13.657986925155127, 14.058341453040232, 13.751822923564026, 13.936886101042488, 13.90058603143137, 14.193189631919063, 14.225976069809075, 14.830844952562549]], [0.05403050108932467, 0.20740740740740726, 0.31372549019607837],
309
+ },
310
+ "2022": {
311
+ "x": list(range(1, 88)),
312
+ "y": [15.816438075969113, 16.120385966332037, 15.882429676047822, 15.754141510831133, 15.3879948181939, 14.847440397508679, 14.559122186153141, 14.392608974240208, 14.271479310233566, 14.151814366776497, 14.033446724531911, 13.971139835079242, 13.946657171368635, 13.923168976370057, 13.908213326289514, 13.903962921781009, 13.883435189687164, 13.868214256361957, 13.853316203275403, 13.850156274630233, 13.83800413007661, 13.828456929678238, 13.823667080256051, 13.837379627152984, 13.85468762648662, 13.842118819095077, 13.846068401970452, 13.866145193860882, 13.87683103331106, 13.883902318309158, 13.843314542816382, 13.848955212935406, 13.825679672773983, 13.825203585467685, 13.800650657685432, 13.771987156235094, 13.745277332204294, 13.74899618896188, 13.710350289788519, 13.699009636752562, 13.72574984380712, 13.69379612714152, 13.657631333739795, 13.687110795197487, 13.641654848107489, 13.68555427745178, 13.626523037803157, 13.656569173850187, 13.64357081552712, 13.655564923630237, 13.650126005189923, 13.66108116025011, 13.636544222792033, 13.663746867549065, 13.626176670833402, 13.59824157968966, 13.674717201935882, 13.694557928731372, 13.727707429817114, 13.657670720998764, 13.54889394004633, 13.69650375543492, 13.692110648403906, 13.55263976838036, 13.630076360505104, 13.593884835135345, 13.596113596592723, 13.602738980430088, 13.490250965065599, 13.698940481247519, 13.583385809300575, 13.60991931296976, 13.581332737838016, 13.824623548139833, 13.533893973585819, 13.533775394793583, 13.755699578934374, 13.759936297399996, 13.87244513763899, 13.616014488643092, 14.09812993251356, 13.710074602518604, 13.91784066420223, 13.912311265620039, 14.203969619716446, 14.255022778711806, 14.830844952562549]], [0.027015250544662334, 0.10370370370370363, 0.15686274509803919],
313
+ },
314
+ "2023": {
315
+ "x": list(range(1, 88)),
316
+ "y": [14.789164834058647, 14.780127256037884, 14.819678850556608, 14.733221736292204, 14.715123895744814, 14.569614305023329, 14.396346309952783, 14.267962672112828, 14.173985658599138, 14.070884007245896, 13.974284099164725, 13.918302031044524, 13.898843341205037, 13.879919458330534, 13.865098670719211, 13.851559827592494, 13.844906626448243, 13.827295800961403, 13.820810936762644, 13.809543815857673, 13.804536613446562, 13.804859924468062, 13.785889612091664, 13.802986923401033, 13.830453100698728, 13.816370948078971, 13.830157632336801, 13.839051100924063, 13.84746613758983, 13.860297269342437, 13.815378459306658, 13.812782079759149, 13.793416550465908, 13.815821643865219, 13.78691014152164, 13.740292216550131, 13.709841553660574, 13.745287154982947, 13.691633688757076, 13.67702798250515, 13.665734867137164, 13.660225685620617, 13.636580976940015, 13.658398179452709, 13.607051808944078, 13.641436611855841, 13.593798625450953, 13.61361178624699, 13.638190686281677, 13.646499055714083, 13.591038080776018, 13.622992917555028, 13.587839722276074, 13.630829824495837, 13.629461225299615, 13.592200956351647, 13.615680520490306, 13.630341745716859, 13.677426157763774, 13.626805264232148, 13.564525550141198, 13.67038341024563, 13.672981832082215, 13.525896811417093, 13.563993050553714, 13.611941675078645, 13.553760533281189, 13.59021111451196, 13.470082500603052, 13.59912543494902, 13.509683974597134, 13.521390742472398, 13.520602741034393, 13.725732516220367, 13.402650383856045, 13.482679094860476, 13.645693009561771, 13.775875527667997, 13.832068021284835, 13.498004659433413, 14.094763215759677, 13.660926796721734, 13.834609766490832, 13.863488794330497, 14.180579199558213, 14.222775721949759, 14.830844952562549],
317
+ },
318
+ }
319
+
320
+ fig = go.Figure()
321
+
322
+ # Add a line for each year
323
+ for year, values in data.items():
324
+ x_values = values["x"]
325
+ y_values = values["y"]
326
+
327
+ fig.add_trace(go.Scatter(
328
+ x=x_values,
329
+ y=y_values,
330
+ mode='lines+markers',
331
+ name=year
332
+ ))
333
+
334
+ # Update layout
335
+ fig.update_layout(
336
+ title="Perplexity Across Different Dump Duplication Counts (local)",
337
+ xaxis_title="Number of Dumps Duplication",
338
+ yaxis_title="Average Perplexity",
339
+ legend_title="Year"
340
+ )
341
+
342
+ # Show figure
343
+ graph6 = fig
344
+
345
 
346
  intro_div = Div(
347
  H2("Perplexity Evaluation on Duplicate Data"),
 
387
  H3("Perplexity vs Local Dump Duplication"),
388
  P("Following the same practice, we can plot the local version of the graph of average perplexity with respect to dump duplication."),
389
  Img(src="images/prep-diff-dump-dump-counts-local.png", height = "300", width = "600" ),
390
+ plotly2fasthtml(graph6),
391
  ),
392
  )
393