CourseAI Engineering: The Complete Course · Module 5: NLP for Applications · part 40 of 105
Part 40 · Module 5: NLP for Applications

Lab: Keyword search over the help centre

17 min read·13 Oct 2026
Module 5 · Lab · About 60 minutes · Needs: lessons 1, 2 and 5 (cleaning and tokens, BM25, error analysis by hand)

What you are building

WHAT THE LAB BUILDS ticket tokenise() BM25 index search() top 3 brightcart_bm25.json fingerprinted 21 tickets: hit@1, hit@3
The finished piece: a ticket goes through the cleaning and the BM25 index to the top 3 articles (blue, your system; green, the output), measured on 21 tickets (amber, the part you are unsure of) and saved as a fingerprinted file.

Priya's request from lesson 2 still stands: when a ticket arrives, attach the help article that answers it. In this lab you build that as one function, search(query), over the 12 help articles. It cleans and tokenises text with lesson 1's functions, scores articles with lesson 2's BM25, and returns the top 3. Then, as lesson 5 taught, you measure it on real tickets, read every mistake by hand and count what one fix fixed and broke. Last, you save the index to a file with a fingerprint, so a stale index cannot be loaded by mistake. No model is called and no key is needed. The running example is a real shared ticket: "Refund still not received after two weeks!!"

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.