Skip to main content
SLOP1276 Applied Algorithmic Romance & Profile OptimizationSemester 1, 2027

Week 4 Tutorial: Natural Language Processing in Profile Bios

Tokenise clichés, hold the photo constant and A/B test fictional bios. Explain why a pooled winner can lose in both exposure groups.

18 March 2027

Inputs

Bring your Platform audit, Photo asset manifest and the Week 4 texts, tokenizer, exposure CSV, model and workbook. The five downloads run together with node week-04-worked-examples.mjs; a spreadsheet or another language is accepted.

Finish with The bio lab has a premature winner: the interactive quiz. Six new cases include a token diagram, candidate revisions and an exposure table. Apply the week’s text and experiment rules, then submit all six responses to unlock the score and worked explanations. The quiz is practice and carries no course marks.

The 50-slide pack and worked lecture notes supply the prompts and answers. Bring completed lecture exercises for checking and refinement; do not repeat them just to fill time. Solo implementation and review are accepted.

Use the manifest’s A-portrait-v1 for both bio variants: identical bytes, crop, alt text and display treatment. Alex’s Friday 5–7 pm window, $20 total budget, bus travel, board games, puns and relationship possibility stay fixed. The authored bios have no measured outcomes; the CSV’s A/B labels do not identify those texts.

Follow the 60-minute lecture selection and independent-work plan. Complete the preparation and open the workbook before Thursday. The four blocks below are the entire 90-minute tutorial; use existing lecture or study working for review and refinement. Remaining pack material belongs to the week’s independent study allocation.

90-minute tutorial

  1. 20 minutes — implement and inspect the text pipeline. Count original Unicode code points against the 150 ceiling. Follow the declared ASCII tokenizer and exact dictionary; union overlapping token spans. Test the 150/151 boundary, punctuation, overlapping phrases and empty-token input. Reproduce A’s 80 code points and 3/14 coverage, and B’s 101 code points and 0/20. Quote evidence for clarity, specificity, feasibility and exit using the toolkit’s anchors. Repair missing logistics without inventing facts; the notes include a 103-code-point answer.
  2. 25 minutes — reproduce and explain the reversal. Use the first five minutes for The Experiment That Lied: record a prediction, open the totals and reveal the zones. Then validate all four zone/variant rows and their counts. Calculate North’s 30%/35%, South’s 10%/15% and the pooled 26%/19%. Recover the 80% versus 20% North exposure weights. Reweight both to a declared 50/50 target: 20%/25%. Explain why neither the pooled nor standardised summary proves a text effect.
  3. 20 minutes — check uncertainty and units. Use the separate 120/1000 versus 140/1000 fixture in the calculator. Reproduce a two-percentage-point difference, pooled rate 0.13, SE about 0.01504 and z about 1.33. Reverse the arms; scale the counts by ten; try 2/8 versus 4/8. State what each change preserves and what the calculator cannot conclude. Do not substitute its pooled z for an analysis of the proposed stratified trial.
  4. 25 minutes — pre-register, preflight and take the quiz. Use fifteen minutes to adapt the notes’ synthetic protocol: unique simulated viewer IDs, within-zone random allocation, frozen photo and texts, one outcome and observation window, missing-record handling, analysis weights, worthwhile effect, uncertainty plan and fixed stopping rule. Record that no outcomes exist yet and that the sample cap is not a power guarantee. Repair the Monday/photo A versus Sunday/photo B example. Correct the manager’s three report claims with explicit denominators and scope. Use the final ten minutes for the six-case quiz: about eight minutes to respond and two to review the explanations after all cases are answered.

Deliverable: Bio experiment protocol

During the fifteen-minute protocol portion of the final block, use your investigation’s evidence-note form to record the conclusion, limitations and proposed controls. Download the note alongside your existing working; the outline helps organise the full protocol below. Release Day will consume this record in Week 12. Both investigations are ungraded exploratory practice with immediate feedback, separate from the six-case quiz and its submission gate.

Save one folder containing:

No experiment on real app users is permitted. A simulated generator, its assumptions and seed would need to be specified before any later run; the supplied aggregate CSV is not an individual assignment log.

The market report is due 19 March, 5 pm. It uses the denominator audit, reversal and proposed follow-up; it does not require a finished profile. Week 5 uses your supported bio candidate, frozen photo and denominator definitions to model mutual selection.

Interactive quiz · 6 cases · about 8 minutes + 2 to review

The bio lab has a premature winner

Someone has written the victory headline. The experiment has some corrections.

Make a decision in every case, then select Reveal answers. You can change any response before submitting. Scores and explanations stay hidden until the whole quiz is answered.

All text fragments and counts are authored teaching fixtures. The numerical cases are separate from the candidate bios and have no real-user outcomes. Practice only: no course marks. Responses stay on this page; reloading starts a fresh attempt.

The cases are readable without JavaScript. Enable JavaScript to navigate, submit your responses and unlock the explanations.

Case 01 / 06The counter has two opinions

Count the original Unicode code points

A test string contains 148 ASCII letters, followed by U+1F680 (one supplementary Unicode code point), followed by one ASCII space. The course ceiling is 150 code points in the original string, including spaces. A teammate uses JavaScript text.length and rejects it.

Which budget check follows the course rule?

Case 02 / 06The optimiser buys Alex a car

Revise with evidence, not inventions

Alex likes board games and bad puns, is free Friday 5–7 pm, travels by bus, has $20 total and is open to a relationship. No car or Saturday availability is supplied. All four proposed bios fit the 150-code-point ceiling; a low cliché score cannot resolve their factual differences.

Which revision preserves the supplied facts and explicitly allows a pass?

Case 03 / 06The cliché meter reaches 125%

Union overlapping token positions

The separate pipeline test fragment is “partner-in-crime tonight”. Lowercase and split using maximal [a-z0-9]+ runs. For this case, the exact dictionary contains both “partner in crime” and “in crime”. A teammate adds the lengths of both matches, counting some positions twice.

Four tokens in order: position 0 partner, position 1 in, position 2 crime, position 3 tonight. No match positions are marked.
The tokenizer output is supplied. Find both dictionary matches, then count each covered position once.

Model supplied
Coverage (%) = 100 × number of distinct covered token positions / total number of tokens.

What percentage of token positions is covered? Enter the percentage as a number, without the % sign.

Enter one number. A calculator and your lecture notes are welcome.

Case 04 / 06The dashboard orders confetti

Audit audience weights before pooling

A new invented observational table records at most one positive per exposure. Its A/B labels identify unknown wordings, not the revisions above. There is no randomisation log. The manager sees equal total exposures and prepares a causal victory claim for A.

Separate synthetic exposure fixture · positives / exposures
ZoneAB
North36 / 6014 / 20
South2 / 2012 / 60

Which report survives the zone and shared-weight checks?

Case 05 / 06Six points put on a percent costume

Keep units and approximation limits visible

A separate sparse fixture has A = 6 positives from 50 observations and B = 9 from 50. The course calculator requires at least ten positives and ten negatives in each arm before using its normal approximation.

Which calculation and uncertainty decision are supported?

Case 06 / 06The experiment that stops when it wins

Pre-register the unit, controls and stopping rule

Before generating any outcomes, a team proposes counting every profile reopening as a new trial, treating missing logs as negative responses and adding simulated viewers until bio B wins. Week 3’s frozen photo and fixed case facts are available.

Which repair belongs in the protocol before the simulation runs?

Answer all 6 cases to unlock your score and the worked explanations.

The spec

Before you finish, check your engineering artefact against these requirements.

Teaching team