%22%22%22A%20marimo%20notebook%20that%20writes%20custom%20audiences%20for%20the%20local%20explanations%20of%20an%20EBM.%22%22%22%0A%0Aimport%20marimo%0A%0A__generated_with%20%3D%20%220.25.2%22%0Aapp%20%3D%20marimo.App(width%3D%22medium%22)%0A%0Awith%20app.setup%3A%0A%20%20%20%20from%20typing%20import%20override%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20os%0A%0A%20%20%20%20import%20marimo%20as%20mo%0A%20%20%20%20import%20polars%20as%20pl%0A%20%20%20%20from%20interpret.glassbox%20import%20ExplainableBoostingClassifier%0A%20%20%20%20from%20sklearn.datasets%20import%20fetch_openml%0A%0A%20%20%20%20from%20ebaml%20import%20(%0A%20%20%20%20%20%20%20%20Audience%2C%0A%20%20%20%20%20%20%20%20DataScientist%2C%0A%20%20%20%20%20%20%20%20DescribeEBMRequest%2C%0A%20%20%20%20%20%20%20%20ExplainInstanceRequest%2C%0A%20%20%20%20%20%20%20%20InvalidOptionError%2C%0A%20%20%20%20%20%20%20%20Layperson%2C%0A%20%20%20%20%20%20%20%20PromptOptions%2C%0A%20%20%20%20%20%20%20%20compute_local_facts%2C%0A%20%20%20%20%20%20%20%20describe_ebm%2C%0A%20%20%20%20%20%20%20%20explain_instance%2C%0A%20%20%20%20%20%20%20%20facts_to_texts%2C%0A%20%20%20%20%20%20%20%20likelihood_word%2C%0A%20%20%20%20%20%20%20%20points_towards%2C%0A%20%20%20%20%20%20%20%20round_value%2C%0A%20%20%20%20%20%20%20%20sample_size_word%2C%0A%20%20%20%20%20%20%20%20strength_word%2C%0A%20%20%20%20)%0A%20%20%20%20from%20ebaml.core.custom_types%20import%20JSONObject%0A%0A%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20Audience%2C%0A%20%20%20%20%20%20%20%20DataScientist%2C%0A%20%20%20%20%20%20%20%20DescribeEBMRequest%2C%0A%20%20%20%20%20%20%20%20ExplainInstanceRequest%2C%0A%20%20%20%20%20%20%20%20ExplainableBoostingClassifier%2C%0A%20%20%20%20%20%20%20%20InvalidOptionError%2C%0A%20%20%20%20%20%20%20%20JSONObject%2C%0A%20%20%20%20%20%20%20%20Layperson%2C%0A%20%20%20%20%20%20%20%20PromptOptions%2C%0A%20%20%20%20%20%20%20%20compute_local_facts%2C%0A%20%20%20%20%20%20%20%20describe_ebm%2C%0A%20%20%20%20%20%20%20%20explain_instance%2C%0A%20%20%20%20%20%20%20%20facts_to_texts%2C%0A%20%20%20%20%20%20%20%20fetch_openml%2C%0A%20%20%20%20%20%20%20%20likelihood_word%2C%0A%20%20%20%20%20%20%20%20mo%2C%0A%20%20%20%20%20%20%20%20os%2C%0A%20%20%20%20%20%20%20%20pl%2C%0A%20%20%20%20%20%20%20%20points_towards%2C%0A%20%20%20%20%20%20%20%20round_value%2C%0A%20%20%20%20%20%20%20%20sample_size_word%2C%0A%20%20%20%20%20%20%20%20strength_word%2C%0A%20%20%20%20)%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%20Write%20your%20own%20audience%0A%0A%20%20%20%20A%20local%20explanation%20says%20*why%20the%20model%20predicted%20this%20for%20this%20person*.%20Who%20reads%20it%20changes%20what%20a%20good%0A%20%20%20%20explanation%20is.%20A%20layperson%20needs%20words%20in%20place%20of%20log-odds.%20A%20data%20scientist%20wants%20the%20log-odds.%20A%20regulator%20wants%0A%20%20%20%20the%20direction%20of%20every%20effect%20and%20no%20probability%20at%20all.%20EBaMl%20ships%20two%20audiences%2C%20%60Layperson%60%20and%0A%20%20%20%20%60DataScientist%60%2C%20and%20the%20base%20class%20%60Audience%60%20lets%20you%20add%20your%20own.%0A%0A%20%20%20%20An%20audience%20does%20two%20jobs%3A%0A%0A%20%20%20%201.%20**It%20decides%20which%20facts%20the%20LLM%20gets.**%20One%20method%20for%20each%20kind%20of%20fact%20(%60contribution%60%2C%20%60prediction%60%2C%0A%20%20%20%20%20%20%20%60change%60%2C%20%60flip%60%2C%20%60class_output%60%2C%20%60margin%60%2C%20%60guarantee%60%2C%20%60support%60%2C%20%60lower_bound%60%2C%20%60share%60%20and%20%60sample%60)%20returns%0A%20%20%20%20%20%20%20the%20keys%20that%20the%20audience%20adds%20to%20it.%20A%20number%20that%20the%20audience%20leaves%20out%20is%20a%20number%20that%20the%20LLM%20cannot%0A%20%20%20%20%20%20%20repeat.%0A%20%20%20%202.%20**It%20tells%20the%20LLM%20how%20to%20write.**%20The%20method%20%60guidance%60%20returns%20the%20instruction%2C%20with%20its%20reason.%0A%0A%20%20%20%20All%20the%20methods%20are%20abstract%2C%20so%20an%20author%20decides%20on%20every%20model%20number.%20There%20are%20two%20ways%20in.%20**Subclass%20a%0A%20%20%20%20built-in%20audience**%20and%20override%20the%20one%20method%20that%20differs%3A%20this%20is%20the%20short%20way.%20**Subclass%20%60Audience%60**%20and%0A%20%20%20%20write%20every%20method%3A%20this%20is%20the%20way%20for%20an%20audience%20with%20new%20rules.%0A%0A%20%20%20%20This%20notebook%20builds%20six%20audiences%20for%20six%20readers%20(a%20child%2C%20a%20chief%20executive%2C%20a%20reader%20of%20Simplified%20Technical%0A%20%20%20%20English%2C%20a%20loan%20officer%2C%20a%20machine%20learning%20engineer%20and%20a%20regulator).%20It%20shows%20the%20facts%20that%20each%20one%20produces%2C%0A%20%20%20%20and%20the%20errors%20you%20meet%20when%20an%20audience%20is%20wrong.%20To%20change%20only%20the%20language%20of%20the%20explanation%2C%20you%20need%20no%0A%20%20%20%20audience%3A%20pass%20%60language%3D%60%20(see%20the%20languages%20notebook).%0A%0A%20%20%20%20Everything%20works%20without%20a%20key%20until%20the%20last%20cells.%20Those%20cells%20call%20the%20LLM%2C%20and%20they%20only%20run%20when%20you%20press%0A%20%20%20%20their%20button.%20The%20default%20model%20needs%20%60OPENROUTER_API_KEY%60.%20To%20use%20another%20model%2C%20pass%20%60model%3D%60%3A%0A%20%20%20%20see%20the%20documentation%20page%20%22Choosing%20the%20model%22.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(mo%2C%20os)%3A%0A%20%20%20%20key_from_env%20%3D%20bool(os.environ.get(%22OPENROUTER_API_KEY%22))%0A%20%20%20%20api_key_input%20%3D%20None%20if%20key_from_env%20else%20mo.ui.text(kind%3D%22password%22%2C%20label%3D%22OpenRouter%20API%20key%22%2C%20full_width%3DTrue)%0A%20%20%20%20key_status%20%3D%20(%0A%20%20%20%20%20%20%20%20mo.callout(%22Loaded%20%60OPENROUTER_API_KEY%60%20from%20the%20environment.%22%2C%20kind%3D%22success%22)%0A%20%20%20%20%20%20%20%20if%20key_from_env%0A%20%20%20%20%20%20%20%20else%20mo.vstack(%5Bmo.callout(%22%60OPENROUTER_API_KEY%60%20is%20not%20set%20in%20the%20environment.%22%2C%20kind%3D%22warn%22)%2C%20api_key_input%5D)%0A%20%20%20%20)%0A%20%20%20%20key_status%0A%20%20%20%20return%20(api_key_input%2C)%0A%0A%0A%40app.cell%0Adef%20_(api_key_input%2C%20os)%3A%0A%20%20%20%20%23%20a%20typed%20key%20only%20lives%20in%20this%20process%3B%20the%20BAML%20clients%20read%20the%20variable%20when%20they%20send%20a%20request%0A%20%20%20%20if%20api_key_input%20is%20not%20None%20and%20api_key_input.value%3A%0A%20%20%20%20%20%20%20%20os.environ%5B%22OPENROUTER_API_KEY%22%5D%20%3D%20api_key_input.value%0A%20%20%20%20has_api_key%20%3D%20bool(os.environ.get(%22OPENROUTER_API_KEY%22))%0A%20%20%20%20return%20(has_api_key%2C)%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%20The%20model%20and%20the%20facts%0A%0A%20%20%20%20The%20same%20Titanic%20EBM%20as%20in%20%60local_explanations.py%60%3A%20a%20binary%20classifier%20without%20interactions.%20The%20facts%20of%20one%0A%20%20%20%20passenger%20come%20from%20%60compute_local_facts%60.%20No%20LLM%20is%20involved%2C%20and%20the%20facts%20do%20not%20depend%20on%20the%20audience.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(ExplainableBoostingClassifier%2C%20fetch_openml%2C%20pl)%3A%0A%20%20%20%20%23%20The%20liac-arff%20parser%20reads%20the%20categories%20as%20text.%20The%20pandas%20parser%20of%20scikit-learn%201.9%20fails%20on%20pandas%203.1.%0A%20%20%20%20titanic%20%3D%20pl.from_pandas(fetch_openml(%22titanic%22%2C%20version%3D1%2C%20as_frame%3DTrue%2C%20parser%3D%22liac-arff%22).frame)%0A%20%20%20%20features%20%3D%20titanic.select(%22pclass%22%2C%20%22sex%22%2C%20%22age%22%2C%20%22sibsp%22%2C%20%22parch%22%2C%20%22fare%22%2C%20%22embarked%22).with_columns(%0A%20%20%20%20%20%20%20%20pl.col(%22sex%22%2C%20%22embarked%22).cast(pl.String)%2C%0A%20%20%20%20)%0A%20%20%20%20survived%20%3D%20titanic%5B%22survived%22%5D.cast(pl.String).cast(pl.Int8)%0A%20%20%20%20ebm%20%3D%20ExplainableBoostingClassifier(feature_names%3Dfeatures.columns%2C%20interactions%3D0%2C%20random_state%3D42)%0A%20%20%20%20ebm.fit(features%2C%20survived)%0A%20%20%20%20complete%20%3D%20features.drop_nulls()%0A%20%20%20%20return%20complete%2C%20ebm%0A%0A%0A%40app.cell%0Adef%20_(complete%2C%20mo)%3A%0A%20%20%20%20passenger%20%3D%20mo.ui.slider(0%2C%20len(complete)%20-%201%2C%20value%3D0%2C%20label%3D%22Passenger%22%2C%20show_value%3DTrue)%0A%20%20%20%20passenger%0A%20%20%20%20return%20(passenger%2C)%0A%0A%0A%40app.cell%0Adef%20_(complete%2C%20compute_local_facts%2C%20ebm%2C%20passenger)%3A%0A%20%20%20%20instance%20%3D%20complete.row(passenger.value%2C%20named%3DTrue)%0A%20%20%20%20facts%20%3D%20compute_local_facts(ebm%2C%20instance)%0A%20%20%20%20return%20facts%2C%20instance%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%201.%20The%20short%20way%3A%20subclass%20a%20built-in%20audience%0A%0A%20%20%20%20Some%20readers%20need%20the%20facts%20of%20a%20layperson%20(words%2C%20no%20model%20numbers)%20and%20a%20different%20instruction.%20For%20each%20of%20them%2C%0A%20%20%20%20the%20class%20below%20subclasses%20%60Layperson%60%20and%20overrides%20%60guidance%60.%20The%20other%20methods%20stay%20as%20they%20are.%20The%0A%20%20%20%20readers%20differ%20in%20role%20and%20style%3A%0A%0A%20%20%20%20-%20%60Eli5%60%20is%20a%20child.%20The%20text%20uses%20short%20sentences%20and%20one%20everyday%20comparison.%0A%20%20%20%20-%20%60Executive%60%20is%20a%20chief%20executive.%20The%20text%20opens%20with%20the%20bottom%20line%20and%20then%20gives%20the%20inputs%20that%20matter%20most.%0A%20%20%20%20-%20%60SimplifiedEnglish%60%20is%20a%20reader%20of%20Simplified%20Technical%20English%20(ASD-STE100)%2C%20for%20example%20a%20technician%20or%20a%20reader%0A%20%20%20%20%20%20who%20learns%20English.%20The%20text%20uses%20one%20idea%20in%20each%20sentence%20and%20the%20same%20word%20for%20the%20same%20thing.%0A%0A%20%20%20%20Each%20instruction%20gives%20the%20reason%20(%22because%20a%20child%20follows%20an%20image%20better%20than%20a%20rule%22)%20as%20well%20as%20the%20order.%20A%0A%20%20%20%20model%20follows%20a%20rule%20better%20when%20it%20knows%20the%20motive.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(Layperson)%3A%0A%20%20%20%20class%20Eli5(Layperson)%3A%0A%20%20%20%20%20%20%20%20%22%22%22A%20layperson%20who%20is%20a%20child%3A%20short%20sentences%20and%20one%20everyday%20comparison.%22%22%22%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20guidance(self)%20-%3E%20str%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22The%20reader%20is%20a%20child%20of%20about%20ten%2C%20so%20use%20short%20sentences%2C%20ordinary%20words%20and%20one%20comparison%20from%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22everyday%20life%2C%20because%20a%20child%20follows%20an%20image%20better%20than%20a%20rule.%20Express%20strength%20and%20likelihood%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22in%20plain%20words%2C%20and%20mention%20only%20values%20of%20the%20person's%20own%20inputs%2C%20because%20model%20numbers%20mean%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22nothing%20to%20this%20reader.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%0A%20%20%20%20class%20Executive(Layperson)%3A%0A%20%20%20%20%20%20%20%20%22%22%22A%20layperson%20who%20decides%3A%20the%20bottom%20line%20first%2C%20then%20the%20inputs%20that%20matter.%22%22%22%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20guidance(self)%20-%3E%20str%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22The%20reader%20is%20a%20chief%20executive%20who%20has%20one%20minute%2C%20so%20open%20with%20the%20bottom%20line%20in%20one%20sentence.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Then%20name%20the%20one%20or%20two%20inputs%20that%20matter%20most%2C%20because%20the%20reader%20decides%20on%20the%20result%20and%20not%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22on%20the%20method.%20Use%20business%20words%2C%20and%20mention%20only%20values%20of%20the%20person's%20own%20inputs%2C%20because%20model%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22numbers%20do%20not%20help%20this%20decision.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%0A%20%20%20%20class%20SimplifiedEnglish(Layperson)%3A%0A%20%20%20%20%20%20%20%20%22%22%22A%20layperson%20who%20reads%20Simplified%20Technical%20English%20(ASD-STE100).%22%22%22%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20guidance(self)%20-%3E%20str%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22The%20reader%20needs%20text%20with%20one%20meaning%2C%20so%20write%20in%20Simplified%20Technical%20English%20(ASD-STE100)%3A%20one%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22idea%20in%20each%20sentence%2C%20at%20most%2020%20words%20in%20a%20sentence%2C%20the%20active%20voice%2C%20the%20simple%20present%20tense%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%20the%20same%20word%20for%20the%20same%20thing%20every%20time.%20Express%20strength%20and%20likelihood%20in%20plain%20words%2C%20and%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22mention%20only%20values%20of%20the%20person's%20own%20inputs%2C%20because%20model%20numbers%20mean%20nothing%20to%20this%20reader.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%0A%20%20%20%20return%20Eli5%2C%20Executive%2C%20SimplifiedEnglish%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%202.%20Change%20one%20rule%3A%20subclass%20%60DataScientist%60%0A%0A%20%20%20%20Two%20readers%20start%20from%20the%20data%20scientist%20and%20change%20a%20rule.%20A%20machine%20learning%20engineer%20wants%20one%20more%20number%20for%0A%20%20%20%20each%20input.%20A%20loan%20officer%20reads%20figures%2C%20but%20only%20one%3A%20the%20probability%2C%20as%20a%20percentage.%20The%20scores%2C%20the%20standard%0A%20%20%20%20deviations%20and%20the%20confidence%20interval%20are%20noise%20for%20this%20reader.%20The%20class%20%60LoanOfficer%60%20subclasses%0A%20%20%20%20%60DataScientist%60%20and%20overrides%20three%20methods%3A%0A%0A%20%20%20%20-%20%60contribution%60%20returns%20no%20key%2C%20so%20a%20contribution%20shows%20the%20feature%20and%20its%20value%20only.%0A%20%20%20%20-%20%60prediction%60%20returns%20the%20probability%20as%20a%20percentage%2C%20in%20place%20of%20the%20probability%2C%20the%20interval%20and%20the%20logit.%0A%20%20%20%20-%20%60guidance%60%20asks%20for%20percentages%20and%20no%20statistics.%0A%0A%20%20%20%20The%20other%20methods%20keep%20the%20rules%20of%20the%20data%20scientist.%20The%20helper%20%60round_value%60%20rounds%20to%20the%20precision%20of%20the%0A%20%20%20%20prompts.%0A%0A%20%20%20%20The%20machine%20learning%20engineer%20debugs%20the%20model.%20An%20effect%20that%20is%20small%20against%20its%20standard%20deviation%20can%20be%20noise%0A%20%20%20%20from%20the%20training%20data.%20The%20class%20%60MLEngineer%60%20adds%20the%20key%20%60signal_to_noise%60%20(the%20size%20of%20the%20score%20divided%20by%20the%0A%20%20%20%20standard%20deviation)%20to%20each%20contribution%2C%20and%20keeps%20every%20other%20rule%20of%20the%20data%20scientist.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(DataScientist%2C%20JSONObject%2C%20round_value)%3A%0A%20%20%20%20class%20LoanOfficer(DataScientist)%3A%0A%20%20%20%20%20%20%20%20%22%22%22A%20reader%20who%20needs%20the%20chance%20of%20the%20outcome%20as%20a%20percentage%2C%20and%20nothing%20else%20about%20the%20model.%22%22%22%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20guidance(self)%20-%3E%20str%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22The%20reader%20is%20a%20loan%20officer%20who%20decides%20with%20percentages%2C%20so%20quote%20the%20percentage%20from%20the%20facts%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22and%20skip%20the%20statistics%20of%20the%20model%2C%20because%20scores%20and%20intervals%20do%20not%20help%20the%20decision.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20contribution(self%2C%20contribution%2C%20prediction)%20-%3E%20JSONObject%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%7B%7D%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20prediction(self%2C%20prediction%2C%20confidence_level)%20-%3E%20JSONObject%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%7B%22percent%22%3A%20round_value(100%20*%20prediction.output)%7D%0A%0A%20%20%20%20class%20MLEngineer(DataScientist)%3A%0A%20%20%20%20%20%20%20%20%22%22%22A%20reader%20who%20debugs%20the%20model%20and%20wants%20the%20signal-to-noise%20ratio%20of%20each%20effect.%22%22%22%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20guidance(self)%20-%3E%20str%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22The%20reader%20is%20a%20machine%20learning%20engineer%20who%20debugs%20the%20model%2C%20so%20quote%20the%20score%20and%20the%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22signal_to_noise%20of%20each%20input.%20Point%20out%20an%20input%20with%20a%20low%20signal_to_noise%2C%20because%20such%20an%20effect%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22may%20be%20noise%20from%20the%20training%20data.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20contribution(self%2C%20contribution%2C%20prediction)%20-%3E%20JSONObject%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ratio%20%3D%20abs(contribution.score)%20%2F%20contribution.std%20if%20contribution.std%20%3E%200%20else%20None%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20**super().contribution(contribution%2C%20prediction)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22signal_to_noise%22%3A%20None%20if%20ratio%20is%20None%20else%20round_value(ratio)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20return%20LoanOfficer%2C%20MLEngineer%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%203.%20New%20rules%3A%20subclass%20%60Audience%60%0A%0A%20%20%20%20A%20regulator%20checks%20that%20the%20model%20uses%20the%20right%20inputs%20in%20the%20right%20direction.%20This%20reader%20wants%20the%20direction%20and%0A%20%20%20%20the%20size%20of%20each%20effect%2C%20in%20words%2C%20and%20no%20probability%20at%20all%2C%20because%20a%20probability%20depends%20on%20the%20threshold%20of%20the%0A%20%20%20%20bank.%20The%20classes%20below%20subclass%20%60Audience%60%20itself%2C%20so%20they%20write%20every%20method.%20Each%20one%20answers%20the%20question%0A%20%20%20%20%22which%20number%20does%20this%20reader%20get%3F%22.%20The%20answers%20are%20in%20the%20table.%20The%20first%20class%20holds%20the%20methods%20of%20the%0A%20%20%20%20numbers%20of%20the%20model.%20The%20second%20class%20adds%20the%20methods%20of%20the%20conditions%20of%20the%20facts%2C%20and%20the%20guidance.%0A%0A%20%20%20%20%7C%20Method%20%7C%20Keys%20of%20this%20audience%20%7C%0A%20%20%20%20%7C%20---%20%7C%20---%20%7C%0A%20%20%20%20%7C%20%60contribution%60%20%7C%20The%20direction%20and%20the%20size%2C%20in%20words%2C%20with%20the%20helpers%20%60points_towards%60%20and%20%60strength_word%60.%20%7C%0A%20%20%20%20%7C%20%60prediction%60%20%7C%20None.%20%7C%0A%20%20%20%20%7C%20%60change%60%20%7C%20The%20direction%20of%20the%20change%20of%20the%20score%2C%20in%20words.%20%7C%0A%20%20%20%20%7C%20%60flip%60%20%7C%20Whether%20the%20flip%20holds%20under%20the%20uncertainty%20of%20the%20model.%20%7C%0A%20%20%20%20%7C%20%60class_output%60%20%7C%20The%20likelihood%20of%20the%20class%20after%20the%20changes%2C%20in%20words.%20%7C%0A%20%20%20%20%7C%20%60margin%60%20%7C%20None.%20%7C%0A%20%20%20%20%7C%20%60guarantee%60%20%7C%20Whether%20the%20sufficient%20reason%20holds%20under%20the%20uncertainty%20of%20the%20model.%20%7C%0A%20%20%20%20%7C%20%60support%60%20%7C%20Whether%20the%20search%20left%20out%20rare%20values.%20%7C%0A%20%20%20%20%7C%20%60lower_bound%60%20%7C%20None.%20%7C%0A%20%20%20%20%7C%20%60share%60%20%7C%20A%20rough%20word%2C%20%60most%60%20or%20%60few%60%2C%20because%20the%20share%20is%20a%20sampling%20estimate.%20%7C%0A%20%20%20%20%7C%20%60sample%60%20%7C%20The%20size%20of%20the%20sample%2C%20in%20a%20word%2C%20with%20the%20helper%20%60sample_size_word%60.%20%7C%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(Audience%2C%20JSONObject%2C%20likelihood_word%2C%20points_towards%2C%20strength_word)%3A%0A%20%20%20%20class%20RegulatorNumbers(Audience)%3A%0A%20%20%20%20%20%20%20%20%22%22%22The%20numbers%20of%20the%20model%20that%20a%20regulator%20gets%3A%20directions%20and%20sizes%20in%20words%2C%20and%20no%20probability.%22%22%22%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20contribution(self%2C%20contribution%2C%20prediction)%20-%3E%20JSONObject%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20direction%20%3D%20%22towards%22%20if%20points_towards(contribution%2C%20prediction)%20else%20%22against%22%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%7B%22direction%22%3A%20direction%2C%20%22size%22%3A%20strength_word(contribution.score)%7D%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20prediction(self%2C%20prediction%2C%20confidence_level)%20-%3E%20JSONObject%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%7B%7D%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20change(self%2C%20change)%20-%3E%20JSONObject%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%7B%22direction%22%3A%20%22up%22%20if%20change.score_change%20%3E%200%20else%20%22down%22%7D%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20class_output(self%2C%20output%2C%20output_kind)%20-%3E%20JSONObject%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%7B%22likelihood%22%3A%20likelihood_word(output)%7D%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20margin(self%2C%20reason%2C%20output_kind)%20-%3E%20JSONObject%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%7B%7D%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20lower_bound(self%2C%20lower_bound%2C%20items)%20-%3E%20JSONObject%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%7B%7D%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20share(self%2C%20share%3A%20float)%20-%3E%20str%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%22most%22%20if%20share%20%3E%201%20%2F%202%20else%20%22few%22%0A%0A%20%20%20%20return%20(RegulatorNumbers%2C)%0A%0A%0A%40app.cell%0Adef%20_(JSONObject%2C%20RegulatorNumbers%2C%20sample_size_word)%3A%0A%20%20%20%20class%20Regulator(RegulatorNumbers)%3A%0A%20%20%20%20%20%20%20%20%22%22%22A%20reader%20who%20checks%20the%20direction%20of%20the%20effects%20and%20wants%20no%20probability.%22%22%22%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20guidance(self)%20-%3E%20str%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22The%20reader%20is%20a%20model%20regulator%20who%20checks%20the%20direction%20of%20every%20effect%2C%20so%20say%20for%20each%20input%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22whether%20it%20pushes%20towards%20or%20against%20the%20prediction%2C%20and%20how%20strongly.%20State%20no%20probability%20and%20no%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22number%20of%20the%20model%2C%20because%20the%20regulator%20judges%20the%20logic%20of%20the%20model%20and%20not%20its%20calibration.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20flip(self%2C%20confidence_level)%20-%3E%20JSONObject%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%7B%22flip_holds_even_if_the_model_is_somewhat_off%22%3A%20confidence_level%20%3E%200%7D%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20guarantee(self%2C%20confidence_level)%20-%3E%20JSONObject%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%7B%22guarantee_holds_even_if_the_model_is_somewhat_off%22%3A%20confidence_level%20%3E%200%7D%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20support(self%2C%20min_support)%20-%3E%20JSONObject%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%7B%22rare_values_left_out%22%3A%20min_support%20%3E%200%7D%0A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20sample(self%2C%20n_samples)%20-%3E%20JSONObject%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%7B%22sample_size%22%3A%20sample_size_word(n_samples)%7D%0A%0A%20%20%20%20return%20(Regulator%2C)%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%20The%20facts%20that%20each%20audience%20produces%0A%0A%20%20%20%20%60facts_to_texts%60%20renders%20the%20same%20facts%20for%20each%20audience.%20Compare%20the%20tabs.%20%60Eli5%60%2C%20%60Executive%60%20and%0A%20%20%20%20%60SimplifiedEnglish%60%20get%20the%20same%20facts%20as%20%60Layperson%60%2C%20because%20they%20only%20change%20%60guidance%60%2C%20so%20the%20tabs%20show%0A%20%20%20%20%60Layperson%60%20for%20all%20four.%20The%20machine%20learning%20engineer%20gets%20%60signal_to_noise%60%20in%20addition%20to%20the%20data%20scientist's%0A%20%20%20%20numbers.%20The%20loan%20officer%20gets%20%60percent%60.%20The%20regulator%20gets%20%60direction%60%20and%20%60size%60%2C%20and%20no%20probability.%0A%20%20%20%20The%20LLM%20reads%20exactly%20these%20texts%2C%20so%20an%20audience%20that%20leaves%20a%20number%0A%20%20%20%20out%20makes%20sure%20that%20the%20LLM%20never%20repeats%20it.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(%0A%20%20%20%20DataScientist%2C%0A%20%20%20%20Eli5%2C%0A%20%20%20%20Executive%2C%0A%20%20%20%20Layperson%2C%0A%20%20%20%20LoanOfficer%2C%0A%20%20%20%20MLEngineer%2C%0A%20%20%20%20Regulator%2C%0A%20%20%20%20SimplifiedEnglish%2C%0A%20%20%20%20facts%2C%0A%20%20%20%20facts_to_texts%2C%0A%20%20%20%20mo%2C%0A)%3A%0A%20%20%20%20audience_objects%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%22Layperson%22%3A%20Layperson()%2C%0A%20%20%20%20%20%20%20%20%22Eli5%22%3A%20Eli5()%2C%0A%20%20%20%20%20%20%20%20%22Executive%22%3A%20Executive()%2C%0A%20%20%20%20%20%20%20%20%22SimplifiedEnglish%22%3A%20SimplifiedEnglish()%2C%0A%20%20%20%20%20%20%20%20%22DataScientist%22%3A%20DataScientist()%2C%0A%20%20%20%20%20%20%20%20%22MLEngineer%22%3A%20MLEngineer()%2C%0A%20%20%20%20%20%20%20%20%22LoanOfficer%22%3A%20LoanOfficer()%2C%0A%20%20%20%20%20%20%20%20%22Regulator%22%3A%20Regulator()%2C%0A%20%20%20%20%7D%0A%20%20%20%20%23%20the%20three%20subclasses%20of%20Layperson%20that%20change%20only%20the%20guidance%20give%20the%20facts%20of%20Layperson%0A%20%20%20%20facts_audiences%20%3D%20%7B%0A%20%20%20%20%20%20%20%20name%3A%20audience%0A%20%20%20%20%20%20%20%20for%20name%2C%20audience%20in%20audience_objects.items()%0A%20%20%20%20%20%20%20%20if%20name%20not%20in%20%7B%22Eli5%22%2C%20%22Executive%22%2C%20%22SimplifiedEnglish%22%7D%0A%20%20%20%20%7D%0A%20%20%20%20audience_texts%20%3D%20%7Bname%3A%20facts_to_texts(facts%2C%20audience)%20for%20name%2C%20audience%20in%20facts_audiences.items()%7D%0A%20%20%20%20mo.ui.tabs(%7B%0A%20%20%20%20%20%20%20%20kind%3A%20mo.hstack(%0A%20%20%20%20%20%20%20%20%20%20%20%20%5Bmo.md(f%22**%7Bname%7D**%5Cn%60%60%60json%5Cn%7Bgetattr(texts%2C%20kind)%7D%5Cn%60%60%60%22)%20for%20name%2C%20texts%20in%20audience_texts.items()%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20align%3D%22start%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20justify%3D%22start%22%2C%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20for%20kind%20in%20(%22prediction%22%2C%20%22counterfactual%22%2C%20%22sufficient_reason%22%2C%20%22completions%22)%0A%20%20%20%20%7D)%0A%20%20%20%20return%20(audience_objects%2C)%0A%0A%0A%40app.cell%0Adef%20_(audience_objects%2C%20mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20%22%23%23%20The%20instruction%20of%20each%20audience%5Cn%5Cn%22%0A%20%20%20%20%20%20%20%20%2B%20%22%5Cn%5Cn%22.join(f%22**%7Bname%7D**%5Cn%5Cn%3E%20%7Baudience.guidance()%7D%22%20for%20name%2C%20audience%20in%20audience_objects.items())%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%20When%20an%20audience%20is%20wrong%0A%0A%20%20%20%20Two%20mistakes%20are%20easy%20to%20make%2C%20and%20both%20fail%20early%2C%20before%20any%20LLM%20call%20and%20before%20you%20pay%20for%20one.%0A%0A%20%20%20%20**An%20unknown%20name.**%20A%20string%20selects%20a%20built-in%20audience%20only.%20A%20custom%20audience%20is%20passed%20as%20an%20object.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(InvalidOptionError%2C%20mo)%3A%0A%20%20%20%20from%20ebaml%20import%20resolve_audience%0A%0A%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20resolve_audience(%22child%22)%0A%20%20%20%20except%20InvalidOptionError%20as%20unknown_name_error%3A%0A%20%20%20%20%20%20%20%20unknown_name_view%20%3D%20mo.callout(f%22%60InvalidOptionError%60%3A%20%7Bunknown_name_error%7D%22%2C%20kind%3D%22danger%22)%0A%20%20%20%20unknown_name_view%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**A%20missing%20method.**%20The%20methods%20are%20abstract.%20If%20you%20forget%20one%2C%20Python%20refuses%20to%20build%20the%20audience%2C%20and%0A%20%20%20%20the%20error%20names%20the%20method.%20This%20is%20the%20reason%20for%20the%20design%3A%20an%20audience%20cannot%20leak%20a%20model%20number%20by%20omission.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(Audience%2C%20mo)%3A%0A%20%20%20%20class%20Forgetful(Audience)%3A%0A%20%20%20%20%20%20%20%20%40override%0A%20%20%20%20%20%20%20%20def%20guidance(self)%20-%3E%20str%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%22The%20reader%20is%20a%20manager.%22%0A%0A%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20Forgetful()%0A%20%20%20%20except%20TypeError%20as%20missing_method_error%3A%0A%20%20%20%20%20%20%20%20missing_method_view%20%3D%20mo.callout(f%22%60TypeError%60%3A%20%7Bmissing_method_error%7D%22%2C%20kind%3D%22danger%22)%0A%20%20%20%20missing_method_view%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%20Put%20it%20in%20words%0A%0A%20%20%20%20Now%20call%20the%20LLM.%20%60explain_instance%60%20takes%20the%20audience%20as%20an%20object.%20It%20needs%20the%20global%20explanation%20of%20the%20model%2C%0A%20%20%20%20computed%20once%20with%20%60describe_ebm%60.%20That%20is%20the%20slow%20step%3A%20one%20chain%20per%20feature%2C%20then%20a%20summary.%20Both%20buttons%20ask%0A%20%20%20%20the%20LLM%2C%20and%20nothing%20runs%20before%20you%20press%20one.%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%20describe_button%20%3D%20mo.ui.run_button(label%3D%22Describe%20the%20model%22)%0A%20%20%20%20describe_button%0A%20%20%20%20return%20(describe_button%2C)%0A%0A%0A%40app.cell%0Adef%20_(%0A%20%20%20%20DescribeEBMRequest%2C%0A%20%20%20%20PromptOptions%2C%0A%20%20%20%20describe_button%2C%0A%20%20%20%20describe_ebm%2C%0A%20%20%20%20ebm%2C%0A%20%20%20%20has_api_key%2C%0A%20%20%20%20mo%2C%0A)%3A%0A%20%20%20%20mo.stop(not%20describe_button.value%2C%20mo.md(%22Press%20the%20button%20to%20describe%20the%20model%20first.%22))%0A%20%20%20%20mo.stop(not%20has_api_key%2C%20mo.callout(%22Enter%20your%20OpenRouter%20API%20key%20above%20first.%22%2C%20kind%3D%22warn%22))%0A%20%20%20%20dataset_description%20%3D%20(%0A%20%20%20%20%20%20%20%20%22The%20RMS%20Titanic%20sank%20in%20April%201912.%20Each%20row%20is%20a%20passenger%3B%20the%20outcome%20is%20whether%20they%20survived.%20%22%0A%20%20%20%20%20%20%20%20%22pclass%20is%20the%20ticket%20class%20(1%20first%2C%203%20third)%2C%20sibsp%20and%20parch%20count%20relatives%20aboard%2C%20%22%0A%20%20%20%20%20%20%20%20%22fare%20is%20in%201912%20pounds%2C%20embarked%20is%20the%20port%20(C%2C%20Q%20or%20S).%20%22%0A%20%20%20%20%20%20%20%20%22The%20graphs%20show%20contributions%20in%20log-odds%20towards%20survival.%22%0A%20%20%20%20)%0A%20%20%20%20with%20mo.status.spinner(%22Describing%20the%20model...%22)%3A%0A%20%20%20%20%20%20%20%20global_explanation%20%3D%20describe_ebm(%0A%20%20%20%20%20%20%20%20%20%20%20%20DescribeEBMRequest(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ebm%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20max_concurrency%3D2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20prompt%3DPromptOptions(dataset_description%3Ddataset_description)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20)%2C%0A%20%20%20%20%20%20%20%20).text%0A%20%20%20%20mo.md(global_explanation)%0A%20%20%20%20return%20dataset_description%2C%20global_explanation%0A%0A%0A%40app.cell%0Adef%20_(audience_objects%2C%20mo)%3A%0A%20%20%20%20audience_choice%20%3D%20mo.ui.dropdown(options%3Dlist(audience_objects)%2C%20value%3D%22Regulator%22%2C%20label%3D%22Audience%22)%0A%20%20%20%20explain_button%20%3D%20mo.ui.run_button(label%3D%22Explain%20this%20prediction%22)%0A%20%20%20%20mo.hstack(%5Baudience_choice%2C%20explain_button%5D%2C%20justify%3D%22start%22)%0A%20%20%20%20return%20audience_choice%2C%20explain_button%0A%0A%0A%40app.cell%0Adef%20_(%0A%20%20%20%20ExplainInstanceRequest%2C%0A%20%20%20%20PromptOptions%2C%0A%20%20%20%20audience_choice%2C%0A%20%20%20%20audience_objects%2C%0A%20%20%20%20dataset_description%2C%0A%20%20%20%20ebm%2C%0A%20%20%20%20explain_button%2C%0A%20%20%20%20explain_instance%2C%0A%20%20%20%20global_explanation%2C%0A%20%20%20%20instance%2C%0A%20%20%20%20mo%2C%0A)%3A%0A%20%20%20%20mo.stop(not%20explain_button.value%2C%20mo.md(%22Press%20the%20button%20to%20explain%20the%20prediction%20of%20the%20passenger%20above.%22))%0A%20%20%20%20with%20mo.status.spinner(%22Asking%20the%20LLM%20(three%20explanations%2C%20concurrently)...%22)%3A%0A%20%20%20%20%20%20%20%20explanation%20%3D%20explain_instance(%0A%20%20%20%20%20%20%20%20%20%20%20%20ExplainInstanceRequest(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ebm%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20instance%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20global_explanation%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20audience%3Daudience_objects%5Baudience_choice.value%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20prompt%3DPromptOptions(dataset_description%3Ddataset_description)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20)%2C%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20%23%23%23%20What%20would%20have%20to%20change%0A%0A%20%20%20%20%7Bexplanation.counterfactual%7D%0A%0A%20%20%20%20%23%23%23%20Which%20inputs%20settle%20it%0A%0A%20%20%20%20%7Bexplanation.sufficient_reason%7D%0A%0A%20%20%20%20%23%23%23%20How%20certain%20it%20gets%20as%20inputs%20become%20known%0A%0A%20%20%20%20%7Bexplanation.completions%7D%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%20Run%20it%20again%20with%20another%20audience%20and%20compare.%20The%20facts%20are%20the%20same.%20The%20numbers%20that%20the%20LLM%20sees%2C%20and%20the%0A%20%20%20%20instruction%20that%20it%20follows%2C%20are%20the%20ones%20of%20the%20audience.%20To%20add%20a%20reader%20of%20your%20own%2C%20write%20a%20subclass%20like%20the%0A%20%20%20%20six%20above%20and%20pass%20an%20object%20of%20it%20as%20%60audience%3D%60.%20To%20get%20the%20explanation%20in%20another%20language%2C%20add%20%60language%3D%60.%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
7ef64878ffea8651924e7100a4e9dafe