import%20marimo%0A%0A__generated_with%20%3D%20%220.25.1%22%0Aapp%20%3D%20marimo.App(width%3D%22medium%22)%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%20Daily%20Quotes%20and%20Jev%0A%0A%20%20%20%20%23%23%20Context%0A%0A%20%20%20%20Each%20year%2C%20I%20create%20and%20track%20a%20%22Quotes%20YYYY%22%20note%20on%20my%20phone.%20Each%20entry%20in%20this%20note%20has%20a%20date%2C%20a%20quote%2Flyric%2Fdefinition%2C%20and%20a%20source.%20Here's%20an%20example%20entry%3A%0A%0A%20%20%20%20%60%60%60text%0A%20%20%20%2008%2F12%2F2022%20-%20%E2%80%9CI%20hate%20stories%20like%20that.%20Men%20only%20think%20about%20the%20past%20right%20before%20their%20death.%20As%20if%20they%20were%20searching%20frantically%20for%20proof%20that%20they%20were%20alive.%E2%80%9D%20-Cowboy%20Bebop%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20Let's%20see%20if%20the%20new%20Jev%20model%20can%20help%20me%20enrich%20these%20raw%20entries%20by%20accurately%20answering%20questions%20about%20them.%20(We'll%20see%20further%20down%20that%20Jev%20will%20return%20typed%20responses%20to%20these%20questions.)%0A%0A%20%20%20%20-%20Does%20this%20entry%20contain%20profanity%3F%20**Noul**%0A%20%20%20%20-%20Does%20this%20entry%20contain%20personally%20identifying%20information%20about%20the%20person%20who%20saved%20it%20(not%20the%20person%20being%20quoted)%3F%20**Noul**%0A%20%20%20%20-%20What%20kind%20of%20entry%20is%20this%3F%20**Choice**%0A%20%20%20%20%20%20%20%20-%20%60quote%2C%20definition%2C%20lyric%2C%20or%20other%60%0A%20%20%20%20-%20If%20this%20entry%20is%20a%20definition%2C%20what%20kind%20of%20word%20is%20being%20defined%3F%20**Choice**%0A%20%20%20%20%20%20%20%20-%20%60noun%2C%20verb%2C%20adjective%2C%20adverb%2C%20other%2C%20or%20not_a_definition%60%0A%20%20%20%20-%20What%20kind%20of%20source%20is%20this%20quote%20attributed%20to%3F%20**Choice**%0A%20%20%20%20%20%20%20%20-%20%60film%2C%20tv%2C%20anime_manga%2C%20music%2C%20book%2C%20real_person%2C%20reddit%2C%20social_media%2C%20youtube%2C%20meme%2C%20or%20other%60%0A%20%20%20%20-%20Should%20the%20source%20of%20this%20quote%20be%20its%20own%20category%2C%20separate%20from%20all%20of%20these%3A%20film%2C%20tv%2C%20anime_manga%2C%20music%2C%20book%2C%20real_person%2C%20reddit%2C%20social_media%2C%20youtube%2C%20meme%2C%20other%3F%20**Noul**%0A%20%20%20%20-%20How%20uplifting%20is%20this%20entry%3F%20**Score**%0A%20%20%20%20%20%20%20%20-%20%60bleak%2C%20somber%2C%20neutral%2C%20hopeful%2C%20or%20joyful%60%0A%20%20%20%20-%20How%20rare%2C%20uncommon%2C%20or%20niche%20is%20this%20quote%20or%20word%3F%20**Score**%0A%20%20%20%20%20%20%20%20-%20%60known%20by%20almost%20everyone%2C%20widely%20known%2C%20known%20within%20a%20fandom%20or%20field%2C%20obscure%2C%20or%20almost%20nobody%20would%20recognize%20it%60%0A%0A%20%20%20%20%23%23%20Running%20the%20Experiment%0A%0A%20%20%20%20I'm%20going%20to%20handwave%20the%20Python%20script%20I%20created%20to%20run%20the%20cleaned%20entries%20through%20the%20Jev%20API%20and%20write%20the%20responses%20to%20a%20local%20file.%20Here's%20what%20the%20API%20calls%20look%20like%2C%20though.%0A%0A%20%20%20%20%60%60%60python%0A%20%20%20%20with%20TypeSafeClient()%20as%20client%3A%0A%20%20%20%20%20%20%20%20%23%20cleaned%20file%20marks%20each%20day%20with%20%22%3D%3D%3D%20%3Cdate%3E%22%20and%20each%20entry%20with%20%22---%22%0A%20%20%20%20%20%20%20%20for%20day%20in%20(Path(__file__).parent%20%2F%20%22words-2022-cleaned.txt%22).read_text().split(%22%5Cn%3D%3D%3D%20%22)%5B1%3A%5D%5B%3A%20args.limit%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20header%20is%20the%20date%20plus%20any%20note%20that%20is%20not%20an%20entry%20itself%20(e.g.%20%22Both%E2%80%A6%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20header%2C%20*entries%20%3D%20day.split(%22%5Cn---%5Cn%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20days.append(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22date%22%3A%20header%5B%3A10%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22entries%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%22text%22%3A%20text%2C%20**client.system_one(state%3Dtext%2C%20questions%3DQUESTIONS).model_dump(mode%3D%22json%22)%7D%20for%20text%20in%20map(str.strip%2C%20entries)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20print(days%5B-1%5D%5B%22date%22%5D%2C%20f%22%7Blen(days%5B-1%5D%5B'entries'%5D)%7D%20entries%22%2C%20flush%3DTrue)%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20I'm%20also%20going%20to%20handwave%20the%20manual%20effort%20I%20went%20through%20to%20answer%20all%20the%20questions%20for%20each%20entry%20myself.%20Ultimately%2C%20both%20Jev's%20answers%20and%20my%20answers%20were%20consolidated%20into%20a%20single%20%60duckdb%60%20file.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Exploring%20the%20Data%0A%0A%20%20%20%20We've%20prepared%20a%20%60duckdb%60%20file%20that%20contains%20normalized%20data%20for%20the%20entries%2C%20questions%2C%20and%20answers%20that%20were%20collected.%20This%20data%20captures%20the%20answers%20that%20I%20manually%20provided%20and%20the%20answers%20that%20Jev%20gave%20from%20behind%20the%20TypeSafe%20AI%20API.%0A%0A%20%20%20%20Here's%20what%20the%20schema%20looks%20like%20for%20the%20%60duckdb%60%20file%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20%23%20the%20README%20holds%20the%20one%20copy%20of%20the%20schema%20diagram%2C%20so%20the%20notebook%20can't%20drift%20from%20it%0A%20%20%20%20mo.vstack(%0A%20%20%20%20%20%20%20%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20mo.md(%22%23%23%20Schema%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20mo.mermaid((mo.notebook_dir()%20%2F%20%22README.md%22).read_text().split(%22%60%60%60mermaid%5Cn%22)%5B1%5D.split(%22%60%60%60%22)%5B0%5D)%2C%0A%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20We%20can%20open%20a%20DuckDB%20connection%2C%20query%20for%20the%20tables%20available%20to%20us%2C%20and%20view%20sample%20rows%20from%20each%20table.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20altair%20as%20alt%0A%20%20%20%20import%20duckdb%0A%20%20%20%20import%20marimo%20as%20mo%0A%0A%20%20%20%20%23%20read%20only%20so%20the%20committed%20database%20never%20changes%20from%20here%2C%20rebuild%20it%20with%20load_duckdb.py%0A%20%20%20%20con%20%3D%20duckdb.connect(str(mo.notebook_dir()%20%2F%20%22answers-2026-10-18-combined.duckdb%22)%2C%20read_only%3DTrue)%0A%20%20%20%20return%20alt%2C%20con%2C%20mo%0A%0A%0A%40app.cell%0Adef%20_(con%2C%20mo)%3A%0A%20%20%20%20_df%20%3D%20mo.sql(%0A%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20show%20tables%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20engine%3Dcon%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(con%2C%20mo)%3A%0A%20%20%20%20_df%20%3D%20mo.sql(%0A%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20from%20entries%20limit%205%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20engine%3Dcon%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(con%2C%20mo)%3A%0A%20%20%20%20_df%20%3D%20mo.sql(%0A%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20from%20questions%20limit%205%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20engine%3Dcon%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(con%2C%20mo)%3A%0A%20%20%20%20_df%20%3D%20mo.sql(%0A%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20from%20question_options%20limit%205%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20engine%3Dcon%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(con%2C%20mo)%3A%0A%20%20%20%20_df%20%3D%20mo.sql(%0A%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20--%20each%20question%20with%20every%20answer%20it%20allows%0A%20%20%20%20%20%20%20%20from%20questions%20q%0A%20%20%20%20%20%20%20%20join%20question_options%20o%20using%20(question)%0A%20%20%20%20%20%20%20%20select%20q.question%2C%20q.type%2C%20q.instructions%2C%20list(o.label%20%7C%7C%20'%20%3D%20'%20%7C%7C%20o.name%20order%20by%20o.label)%20as%20options%0A%20%20%20%20%20%20%20%20group%20by%20all%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20engine%3Dcon%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(con%2C%20mo)%3A%0A%20%20%20%20_df%20%3D%20mo.sql(%0A%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20from%20answers%20limit%205%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20engine%3Dcon%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Exploring%20Different%20Types%20of%20Questions%0A%0A%20%20%20%20We%20can%20view%20how%20Jev%20answers%20different%20question%20types.%0A%0A%20%20%20%20%3E%20**Labels%20vs%20Names**%0A%20%20%20%20%3E%0A%20%20%20%20%3E%20Each%20answer%20in%20the%20database%20stores%20a%20%60label%60.%20Comparing%20answers%20means%20comparing%20labels.%20%60question_options%60%20lists%20every%20%60label%60%20a%20question%20allows%20next%20to%20its%20name%2C%20the%20readable%20text.%0A%20%20%20%20%3E%0A%20%20%20%20%3E%20Each%20%60label%60%20also%20has%20a%20%60name%60%2C%20which%20is%20the%20human-friendly%20description%20of%20the%20%60label%60.%20__%60label%60s%20and%20%60name%60s%20always%20match%20exactly%2C%20except%20for%20Score%20questions.__%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Noul%20(yes%2Fno)%0A%0A%20%20%20%20Jev%20only%20returns%20a%20probability%20that%20the%20answer%20is%20yes%2C%20e.g.%20%600.99%60.%0A%0A%20%20%20%20%60load_duckdb.py%60%20stores%20%60yes%60%20at%200.5%20or%20more%20and%20%60no%60%20otherwise%2C%20and%20the%20raw%20probability%20is%20not%20in%20the%20database.%20The%20label%20and%20name%20are%20both%20%60yes%60%20or%20%60no%60.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(con%2C%20mo)%3A%0A%20%20%20%20_df%20%3D%20mo.sql(%0A%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20--%20first%20noul%20answer%20from%20Jev%2C%20next%20to%20every%20option%20its%20question%20allows%0A%20%20%20%20%20%20%20%20from%20answers%20a%0A%20%20%20%20%20%20%20%20join%20entries%20e%20on%20e.id%20%3D%20a.entry_id%0A%20%20%20%20%20%20%20%20join%20questions%20q%20using%20(question)%0A%20%20%20%20%20%20%20%20join%20question_options%20o%20using%20(question%2C%20label)%0A%20%20%20%20%20%20%20%20select%0A%20%20%20%20%20%20%20%20%20%20%20%20e.text%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20q.question%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20q.instructions%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20a.label%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20o.name%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20(select%20list(all_o.label%20%7C%7C%20'%20%3D%20'%20%7C%7C%20all_o.name%20order%20by%20all_o.label)%20from%20question_options%20all_o%20where%20all_o.question%20%3D%20q.question)%20as%20options%0A%20%20%20%20%20%20%20%20where%20a.source%20%3D%20'jev'%20and%20q.type%20%3D%20'noul'%0A%20%20%20%20%20%20%20%20order%20by%20e.id%2C%20q.question%0A%20%20%20%20%20%20%20%20limit%201%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20engine%3Dcon%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Choice%0A%0A%20%20%20%20Jev%20picks%20one%20of%20the%20option%20keys%20from%20the%20question's%20%60criteria%60%20in%20%60questions.py%60.%20That%20key%20is%20the%20label%2C%20and%20the%20name%20is%20the%20same%20key.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(con%2C%20mo)%3A%0A%20%20%20%20_df%20%3D%20mo.sql(%0A%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20--%20first%20choice%20answer%20from%20Jev%2C%20next%20to%20every%20option%20its%20question%20allows%0A%20%20%20%20%20%20%20%20from%20answers%20a%0A%20%20%20%20%20%20%20%20join%20entries%20e%20on%20e.id%20%3D%20a.entry_id%0A%20%20%20%20%20%20%20%20join%20questions%20q%20using%20(question)%0A%20%20%20%20%20%20%20%20join%20question_options%20o%20using%20(question%2C%20label)%0A%20%20%20%20%20%20%20%20select%0A%20%20%20%20%20%20%20%20%20%20%20%20e.text%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20q.question%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20q.instructions%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20a.label%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20o.name%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20(select%20list(all_o.label%20%7C%7C%20'%20%3D%20'%20%7C%7C%20all_o.name%20order%20by%20all_o.label)%20from%20question_options%20all_o%20where%20all_o.question%20%3D%20q.question)%20as%20options%0A%20%20%20%20%20%20%20%20where%20a.source%20%3D%20'jev'%20and%20q.type%20%3D%20'choice'%0A%20%20%20%20%20%20%20%20order%20by%20e.id%2C%20q.question%0A%20%20%20%20%20%20%20%20limit%201%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20engine%3Dcon%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Score%0A%0A%20%20%20%20Jev%20returns%20a%20number%20on%20the%20scale%2C%20e.g.%20%602.22%60.%20%60load_duckdb.py%60%20rounds%20it%20to%20the%20nearest%20level%2C%20and%20the%20label%20is%20that%20level's%20index%20as%20text%20(%60%220%22%60%20to%20%60%224%22%60).%20The%20name%20is%20the%20readable%20level%20from%20the%20question's%20%60criteria%60%20list%2C%20e.g.%20%600%20%3D%20bleak%60%20for%20%60mood%60.%20Compare%20by%20label%2C%20read%20by%20name.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(con%2C%20mo)%3A%0A%20%20%20%20_df%20%3D%20mo.sql(%0A%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20--%20first%20score%20answer%20from%20Jev%2C%20next%20to%20every%20option%20its%20question%20allows%0A%20%20%20%20%20%20%20%20from%20answers%20a%0A%20%20%20%20%20%20%20%20join%20entries%20e%20on%20e.id%20%3D%20a.entry_id%0A%20%20%20%20%20%20%20%20join%20questions%20q%20using%20(question)%0A%20%20%20%20%20%20%20%20join%20question_options%20o%20using%20(question%2C%20label)%0A%20%20%20%20%20%20%20%20select%0A%20%20%20%20%20%20%20%20%20%20%20%20e.text%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20q.question%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20q.instructions%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20a.label%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20o.name%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20(select%20list(all_o.label%20%7C%7C%20'%20%3D%20'%20%7C%7C%20all_o.name%20order%20by%20all_o.label)%20from%20question_options%20all_o%20where%20all_o.question%20%3D%20q.question)%20as%20options%0A%20%20%20%20%20%20%20%20where%20a.source%20%3D%20'jev'%20and%20q.type%20%3D%20'score'%0A%20%20%20%20%20%20%20%20order%20by%20e.id%2C%20q.question%0A%20%20%20%20%20%20%20%20limit%201%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20engine%3Dcon%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20My%20Answers%20vs%20Jev's%20Answers%0A%0A%20%20%20%20First%2C%20let's%20count%20how%20often%20Jev's%20answers%20exactly%20matched%20mine.%20Here%20are%20the%20aggregate%20values%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(con%2C%20mo)%3A%0A%20%20%20%20agreement%20%3D%20mo.sql(%0A%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20--%20share%20of%20entries%20where%20Jev%20picked%20the%20same%20label%20as%20me%2C%20a%20score%20one%20level%20off%20counts%20as%20a%20miss%0A%20%20%20%20%20%20%20%20from%20answers%20a%0A%20%20%20%20%20%20%20%20join%20answers%20j%20on%20j.entry_id%20%3D%20a.entry_id%20and%20j.question%20%3D%20a.question%20and%20j.source%20%3D%20'jev'%0A%20%20%20%20%20%20%20%20join%20questions%20q%20on%20q.question%20%3D%20a.question%0A%20%20%20%20%20%20%20%20select%20a.question%2C%20q.type%2C%20count(*)%20as%20entries%2C%20round(avg((a.label%20%3D%20j.label)%3A%3Aint)%2C%202)%20as%20agreement%0A%20%20%20%20%20%20%20%20where%20a.source%20%3D%20'alex'%0A%20%20%20%20%20%20%20%20group%20by%20all%0A%20%20%20%20%20%20%20%20order%20by%20agreement%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20engine%3Dcon%2C%0A%20%20%20%20)%0A%20%20%20%20return%20(agreement%2C)%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20If%20we%20care%20about%20particular%20answers%20we%20differed%20on%2C%20we%20can%20query%20for%20them%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(con%2C%20mo)%3A%0A%20%20%20%20_df%20%3D%20mo.sql(%0A%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20--%20every%20answer%20where%20Jev%20and%20I%20differ%0A%20%20%20%20%20%20%20%20from%20answers%20a%0A%20%20%20%20%20%20%20%20join%20answers%20j%20on%20j.entry_id%20%3D%20a.entry_id%20and%20j.question%20%3D%20a.question%20and%20j.source%20%3D%20'jev'%0A%20%20%20%20%20%20%20%20join%20entries%20e%20on%20e.id%20%3D%20a.entry_id%0A%20%20%20%20%20%20%20%20join%20question_options%20ao%20on%20ao.question%20%3D%20a.question%20and%20ao.label%20%3D%20a.label%0A%20%20%20%20%20%20%20%20join%20question_options%20jo%20on%20jo.question%20%3D%20j.question%20and%20jo.label%20%3D%20j.label%0A%20%20%20%20%20%20%20%20select%20e.date%2C%20e.text%2C%20a.question%2C%20ao.name%20as%20alex%2C%20jo.name%20as%20jev%0A%20%20%20%20%20%20%20%20where%20a.source%20%3D%20'alex'%20and%20a.label%20!%3D%20j.label%0A%20%20%20%20%20%20%20%20order%20by%20a.question%2C%20e.date%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20engine%3Dcon%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20We%20can%20use%20our%20earlier%20aggregates%20and%20get%20a%20visual%20feel%20for%20Jev's%20performance%20for%20my%20particular%20use%20case.%20How%20often%20did%20Jev%20and%20I%20agree%20on%20each%20question%3F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(agreement%2C%20alt)%3A%0A%20%20%20%20%23%20every%20chart%20lays%20its%20legend%20out%20in%20one%20row%20along%20the%20bottom%0A%20%20%20%20%40alt.theme.register(%22bottom_legend%22%2C%20enable%3DTrue)%0A%20%20%20%20def%20_()%3A%0A%20%20%20%20%20%20%20%20return%20%7B%22config%22%3A%20%7B%22legend%22%3A%20%7B%22orient%22%3A%20%22bottom%22%2C%20%22direction%22%3A%20%22horizontal%22%7D%2C%20%22view%22%3A%20%7B%22continuousWidth%22%3A%20300%2C%20%22continuousHeight%22%3A%20300%7D%7D%7D%0A%0A%20%20%20%20alt.Chart(agreement%2C%20title%3D%22How%20often%20Jev%20picked%20my%20answer%22).mark_bar().encode(%0A%20%20%20%20%20%20%20%20x%3Dalt.X(%22agreement%22%2C%20axis%3Dalt.Axis(format%3D%22%25%22)%2C%20scale%3Dalt.Scale(domain%3D%5B0%2C%201%5D))%2C%0A%20%20%20%20%20%20%20%20y%3Dalt.Y(%22question%22%2C%20sort%3D%22-x%22)%2C%0A%20%20%20%20%20%20%20%20color%3D%22type%22%2C%0A%20%20%20%20%20%20%20%20tooltip%3D%5B%22question%22%2C%20%22type%22%2C%20%22entries%22%2C%20%22agreement%22%5D%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20OK%2C%20cool.%20We%20agree%20there's%20no%20PII%20in%20these%20entries.%20It%20seems%20like%20we%20don't%20agree%20on%20how%20obscure%20these%20entries%20are%2C%20or%20how%20joyful%20they%20are.%20It's%20interesting%20that%20the%20**Score**%20questions%20are%20performing%20poorly.%20More%20than%20likely%2C%20rounding%20to%20the%20nearest%20label%20when%20building%20the%20%60duckdb%60%20file%20penalizes%20scores%20that%20were%20pretty%20close%20to%20my%20manual%20choice.%0A%0A%20%20%20%20Are%20Jev%20and%20I%20using%20the%20full%20range%20of%20answer%20options%20available%20to%20us%3F%20Let's%20count%20how%20many%20times%20we%20answered%20with%20each%20available%20option.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(con%2C%20mo)%3A%0A%20%20%20%20choice_counts%20%3D%20mo.sql(%0A%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20--%20how%20often%20each%20of%20us%20picked%20each%20medium%20and%20kind%2C%20labels%20picked%20fewer%20than%203%20times%20between%20us%20fold%20together%20so%20the%20donuts%20stay%20readable%0A%20%20%20%20%20%20%20%20with%20counts%20as%20(from%20answers%20select%20question%2C%20source%2C%20label%2C%20count(*)%20as%20entries%20where%20question%20in%20('medium'%2C%20'kind')%20group%20by%20all)%0A%20%20%20%20%20%20%20%20from%20(from%20counts%20select%20*%2C%20sum(entries)%20over%20(partition%20by%20question%2C%20label)%20%3C%203%20as%20rare)%0A%20%20%20%20%20%20%20%20select%20question%2C%20source%2C%20if(rare%2C%20'rare%20(under%203%20picks)'%2C%20label)%20as%20label%2C%20sum(entries)%3A%3Aint%20as%20entries%0A%20%20%20%20%20%20%20%20group%20by%20all%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20engine%3Dcon%2C%0A%20%20%20%20)%0A%20%20%20%20return%20(choice_counts%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20Again%2C%20we%20can%20get%20a%20more%20intuitive%20feel%20for%20these%20results%20if%20we%20use%20a%20visualization.%20We'll%20collapse%20all%20of%20the%20rare%20answer%20choices%20into%20a%20single%20slice%20so%20there's%20less%20noise.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(alt%2C%20choice_counts)%3A%0A%20%20%20%20alt.vconcat(%0A%20%20%20%20%20%20%20%20*%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20alt.Chart(choice_counts)%0A%20%20%20%20%20%20%20%20%20%20%20%20.transform_filter(alt.datum.question%20%3D%3D%20question)%0A%20%20%20%20%20%20%20%20%20%20%20%20.mark_arc(innerRadius%3D50%2C%20stroke%3D%22white%22%2C%20strokeWidth%3D2)%0A%20%20%20%20%20%20%20%20%20%20%20%20.encode(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20theta%3D%22entries%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20sorting%20the%20colors%20by%20total%20picks%20also%20orders%20the%20slices%2C%20so%20both%20donuts%20read%20in%20the%20same%20order%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20color%3Dalt.Color(%22label%22%2C%20sort%3Dalt.EncodingSortField(%22entries%22%2C%20op%3D%22sum%22%2C%20order%3D%22descending%22))%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20tooltip%3D%5B%22source%22%2C%20%22label%22%2C%20%22entries%22%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20.properties(width%3D200%2C%20height%3D200)%0A%20%20%20%20%20%20%20%20%20%20%20%20.facet(column%3Dalt.Column(%22source%22%2C%20title%3DNone)%2C%20title%3Df%22%7Bquestion%7D%20picks%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20question%20in%20%5B%22medium%22%2C%20%22kind%22%5D%0A%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20).resolve_scale(color%3D%22independent%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20Nice%2C%20this%20quickly%20shows%20Jev%20and%20I%20were%20largely%20in%20agreement%20on%20these%20questions.%20In%20fairness%20to%20Jev%2C%20some%20of%20these%20questions%20are%20poorly%20designed%20and%20have%20ambiguous%20answers.%20For%20example%2C%20%60reddit%60%20is%20a%20form%20of%20%60social_media%60%2C%20yet%20both%20are%20available%20options%20for%20the%20%60medium%60%20question.%20Who's%20to%20say%20which%20is%20right%3F%0A%0A%20%20%20%20%3E%20If%20this%20were%20more%20than%20a%20brief%20exploration%20of%20Jev%2C%20more%20effort%20would%20go%20into%20refining%20the%20questions%20and%20grading%20rubrics.%0A%20%20%20%20%3E%0A%20%20%20%20%3E%20One%20learning%20from%20this%20experiment%20is%20that%20Jev%20is%20only%20as%20good%20as%20the%20data%20**AND**%20the%20questions%20you%20feed%20into%20it.%0A%0A%20%20%20%20For%20the%20**Score**%20questions%2C%20Jev's%20answers%20and%20my%20answers%20exist%20on%20the%20same%20relative%20scales.%20Let's%20see%20how%20far%20apart%20our%20answers%20are%20for%20the%20%60mood%60%20of%20each%20entry.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(con%2C%20mo)%3A%0A%20%20%20%20mood%20%3D%20mo.sql(%0A%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20--%20my%20mood%20next%20to%20Jev's%20for%20every%20entry%0A%20%20%20%20%20%20%20%20from%20answers%20a%0A%20%20%20%20%20%20%20%20join%20answers%20j%20on%20j.entry_id%20%3D%20a.entry_id%20and%20j.question%20%3D%20a.question%20and%20j.source%20%3D%20'jev'%0A%20%20%20%20%20%20%20%20join%20entries%20e%20on%20e.id%20%3D%20a.entry_id%0A%20%20%20%20%20%20%20%20select%0A%20%20%20%20%20%20%20%20%20%20%20%20e.id%20as%20entry_id%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20e.date%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20e.text%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20a.label%3A%3Aint%20as%20alex%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20j.label%3A%3Aint%20as%20jev%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20when%20jev%20%3E%20alex%20then%20'jev%20higher'%20when%20jev%20%3C%20alex%20then%20'jev%20lower'%20else%20'match'%20end%20as%20jev_vs_alex%0A%20%20%20%20%20%20%20%20where%20a.source%20%3D%20'alex'%20and%20a.question%20%3D%20'mood'%0A%20%20%20%20%20%20%20%20order%20by%20e.id%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20engine%3Dcon%2C%0A%20%20%20%20)%0A%20%20%20%20return%20(mood%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20As%20always%2C%20let's%20build%20a%20visualization%20to%20get%20an%20intuitive%20understanding%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(alt%2C%20mood)%3A%0A%20%20%20%20_base%20%3D%20alt.Chart(mood%2C%20title%3D%22How%20far%20Jev's%20mood%20is%20from%20mine%22).encode(x%3Dalt.X(%22entry_id%3AO%22%2C%20title%3D%22entry%22%2C%20axis%3Dalt.Axis(labels%3DFalse)))%0A%20%20%20%20%23%20dots%20and%20lines%20share%20one%20scale%2C%20so%20a%20line%20takes%20the%20color%20of%20Jev's%20dot%0A%20%20%20%20_color%20%3D%20alt.Scale(domain%3D%5B%22alex%22%2C%20%22jev%20higher%22%2C%20%22jev%20lower%22%2C%20%22match%22%5D%2C%20range%3D%5B%22%234c78a8%22%2C%20%22%2354a24b%22%2C%20%22%23e45756%22%2C%20%22%239e9e9e%22%5D)%0A%20%20%20%20alt.layer(%0A%20%20%20%20%20%20%20%20_base.mark_rule(strokeWidth%3D2).encode(y%3Dalt.Y(%22alex%22%2C%20title%3D%22mood%22)%2C%20y2%3D%22jev%22%2C%20color%3Dalt.Color(%22jev_vs_alex%3AN%22%2C%20scale%3D_color%2C%20title%3DNone))%2C%0A%20%20%20%20%20%20%20%20%23%20a%20match%20is%20one%20gray%20dot%2C%20otherwise%20mine%20stays%20blue%20and%20Jev's%20shows%20which%20way%20it%20missed%0A%20%20%20%20%20%20%20%20_base.transform_fold(%5B%22alex%22%2C%20%22jev%22%5D%2C%20as_%3D%5B%22source%22%2C%20%22mood%22%5D)%0A%20%20%20%20%20%20%20%20.transform_calculate(dot%3D%22datum.jev_vs_alex%20%3D%3D%20'match'%20%3F%20'match'%20%3A%20datum.source%20%3D%3D%20'alex'%20%3F%20'alex'%20%3A%20datum.jev_vs_alex%22)%0A%20%20%20%20%20%20%20%20.mark_circle(size%3D80%2C%20opacity%3D1)%0A%20%20%20%20%20%20%20%20.encode(%0A%20%20%20%20%20%20%20%20%20%20%20%20y%3Dalt.Y(%22mood%3AQ%22%2C%20title%3D%22mood%22%2C%20scale%3Dalt.Scale(domain%3D%5B0%2C%204%5D%2C%20padding%3D10)%2C%20axis%3Dalt.Axis(values%3D%5B0%2C%201%2C%202%2C%203%2C%204%5D%2C%20format%3D%22d%22))%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20color%3Dalt.Color(%22dot%3AN%22%2C%20scale%3D_color%2C%20title%3DNone)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20tooltip%3D%5B%22date%3AT%22%2C%20%22text%22%2C%20%22alex%22%2C%20%22jev%22%5D%2C%0A%20%20%20%20%20%20%20%20)%2C%0A%20%20%20%20).properties(width%3D%22container%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20Interesting%3A%20we%20have%20a%20lot%20of%20off-by-one%20misses%2C%20like%20we%20hypothesized%2C%20but%20we%20also%20have%20a%20couple%20of%20off-by-two%20cases.%0A%0A%20%20%20%20%3E%20If%20you're%20running%20this%20notebook%20yourself%2C%20you%20can%20hover%20over%20the%20dots%20to%20see%20the%20relevant%20quote.%0A%0A%20%20%20%20OK%2C%20that's%20enough%20analysis%20of%20Jev's%20accuracy.%20The%20quotes%20and%20questions%20aren't%20that%20important%2C%20and%20there%20likely%20isn't%20much%20more%20for%20us%20to%20glean%20from%20them.%0A%0A%20%20%20%20In%20a%20future%20post%2C%20we'll%20explore%20how%20the%20cost%20of%20these%20requests%20scales.%20We'll%20experiment%20with%20how%20different%20combinations%20and%20lengths%20of%20questions%20and%20quotes%20impact%20the%20input%20tokens%20we're%20billed%20for.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
e7954aae5d7a186f76f374b4142f3572