GrepBoard/Manuals
605 manuals ·

Score support chats on a QA checklist with quoted evidence

·Tested on Claude Sonnet 5.5 · 2026-10·Test scope ↓·6 steps

Grading support chats with AI often yields unearned high scores. Require exact quotes for each checklist item and verify them against chat logs with a script.

Grading customer service chat logs with AI often leads to leniency bias, awarding perfect scores without verifying whether the agent performed required steps. To eliminate unearned points, force the model to cite exact verbatim quotes for every checklist item and assign zero points whenever no quote exists. The same quote-verification principle appears in verifying summary quotes.

[1] Prepare the 6 QA checklist items and customer chat transcripts. The test set contains 10 simulated telecom plan consultation chats from 'Apex Mobile'.

checklist.txt
- CHK-01 (Greeting): Did the agent introduce the company (Apex Mobile) and provide their name in the greeting?- CHK-02 (Verify): Did the agent verify customer identity (name, date of birth, or account/phone number)?- CHK-03 (Inquiry): Did the agent inquire about current usage or monthly data/voice patterns?- CHK-04 (Solution): Did the agent recommend a specific plan name, monthly price, and key allowance?- CHK-05 (Notice): Did the agent disclose contract terms, discount conditions, or early termination fees?- CHK-06 (Closing): Did the agent ask if there are any further questions and provide a polite closing?

Here is the transcript for CHAT-001, a reference conversation pre-graded by human QA. The full 10 transcripts reside in run/chats.en.txt.

chats.sample.txt
[CHAT-001]Agent: Hello, thank you for contacting Apex Mobile. My name is John. How can I help you today?Customer: My current phone bill feels too high, so I want to switch plans.Agent: I can certainly help with that. To look up your current plan, could you please confirm your full name and date of birth?Customer: David Miller, May 14, 1992.Agent: Thank you for confirming. Looking at your past bills, is your average monthly data usage around 15GB?Customer: Yes, that is right, about 15GB.Agent: In that case, I recommend our 'Smart 5G 55' plan, which offers 20GB of high-speed data followed by unlimited 1Mbps data for $55 per month.Customer: That sounds great. Let's do that.Agent: Excellent. This plan comes with a 12-month contract discount at $41.25 per month, though an early termination fee applies if cancelled before the term ends.Customer: Got it, that sounds fair.Agent: The plan change has been completed. Do you have any other questions or need further assistance today?Customer: No, that is all. Thank you!Agent: Thank you for choosing Apex Mobile. Have a wonderful day!
  • CHAT-001: Compliant across all 6 criteria (Human score: 6/6).
  • CHAT-002: Skipped customer verification (CHK-02) and moved directly to recommendation (Human score: 5/6).
  • CHAT-003: Omitted contract notice (CHK-05) and final closing (CHK-06) (Human score: 4/6).

[2] Construct a prompt that withholds points without verbatim quotes. Enclose instructions, checklist, and logs in separate XML tags following Anthropic's prompt engineering guidelines.

prompt_template.txt
<instructions>You are a Quality Assurance (QA) specialist evaluating customer service chats for a telecom carrier.Evaluate each chat log in <chat_logs> against the 6 QA criteria defined in <checklist>. Rules:1. For each chat (Chat_ID) and checklist item (Item_ID), assign a Score of 1 or 0.2. If Score is 1, you MUST copy the exact verbatim quote (character for character) spoken by the Agent into the Quote column. Do not paraphrase or summarize.3. If no evidence exists or the agent failed, assign Score 0 and write exactly None in the Quote column.4. Never assign Score 1 without an exact verbatim quote from the Agent.5. Output ONLY the markdown table below. Output Format:| Chat_ID | Item_ID | Score | Quote | Reason |</instructions> <checklist>{checklist}</checklist> <chat_logs>{chat_logs}</chat_logs>

[3] Execute the prompt and capture the scorecard table. Disable tools with --tools "" to obtain plain text output.

console
$ claude -p --model claude-sonnet-5-5 --max-turns 1 --tools "" --setting-sources "" --strict-mcp-config < run/qa_scoring_en.prompt.txt > run/qa_scoring_en.out.txt$ head -n 6 run/qa_scoring_en.out.txt| Chat_ID | Item_ID | Score | Quote | Reason ||---|---|---|---|---|| CHAT-001 | CHK-01 | 1 | Hello, thank you for contacting Apex Mobile. My name is John. | Agent named the company and gave their own name. || CHAT-001 | CHK-02 | 1 | could you please confirm your full name and date of birth? | Agent requested name and DOB. || CHAT-001 | CHK-03 | 1 | Looking at your past bills, is your average monthly data usage around 15GB? | Agent asked about monthly data usage. || CHAT-001 | CHK-04 | 1 | In that case, I recommend our 'Smart 5G 55' plan, which offers 20GB of high-speed data followed by unlimited 1Mbps data for $55 per month. | Plan name, price and allowance all given. |…

All 60 evaluation rows (10 chats x 6 items) were generated in a structured table. A second execution (run/qa_scoring_en_2.out.txt) gave the same score for all 60 items; 9 of the 60 quotes differed.

[4] Write a verification script to validate quotes against chat transcripts. It checks that every row has 5 columns and a Score of 0 or 1; that the 60 keys (10 chats x 6 items) each appear once (missing, extra and duplicate rows are errors); that a quote on a score-1 row sits inside a single agent turn of the same chat (a customer line or a sentence from another chat fails); that score-0 rows have None; and that the six scores of the 3 baseline chats (CHAT-001 to CHAT-003) equal the human-graded baseline. There is no minimum quote length, it cannot judge whether a quote really meets the item's criterion, and scores outside the 3 baseline chats are not checked.

run/verify_qa_en.py
import re, sys AGENT = "Agent"ITEMS = [f"CHK-0{i}" for i in range(1, 7)]HUMAN = {"CHAT-001": "111111", "CHAT-002": "101111", "CHAT-003": "111100"}   # 3 human-graded baselines agent_lines, cur = {}, Nonefor line in open(sys.argv[1], encoding="utf-8"):    m = re.match(r"\[(CHAT-\d{3})\]", line.strip())    if m:        cur = m[1]; agent_lines[cur] = []    elif cur and line.startswith(AGENT + ":"):        agent_lines[cur].append(" ".join(line.split(":", 1)[1].split())) rows = [[c.strip() for c in l.strip().strip("|").split("|")] for l in open(sys.argv[2], encoding="utf-8") if l.startswith("| CHAT-")]errors, scores = 0, {}for r in rows:    if len(r) != 5 or r[2] not in ("0", "1"):        print(f"FORMAT {r[:3]}"); errors += 1; continue    cid, item, score, quote, _ = r    if (cid, item) in scores:        print(f"DUP {cid} {item}"); errors += 1    scores[(cid, item)] = score    q = " ".join(quote.split())    if score == "1" and not any(q in u for u in agent_lines.get(cid, [])):        print(f"MISS {cid} {item}: quote not inside one agent turn {q[:30]!r}"); errors += 1    if score == "0" and q != "None":        print(f"MISS {cid} {item}: score 0 but has quote {q[:30]!r}"); errors += 1expected = {(c, i) for c in agent_lines for i in ITEMS}for key in sorted(expected - set(scores)):    print(f"ABSENT {key[0]} {key[1]}"); errors += 1for key in sorted(set(scores) - expected):    print(f"EXTRA {key[0]} {key[1]}"); errors += 1for cid, want in HUMAN.items():    got = "".join(scores.get((cid, i), "?") for i in ITEMS)    if got != want:        print(f"HUMAN {cid}: model {got} / baseline {want}"); errors += 1print(f"{len(scores)} items checked, {errors} errors")sys.exit(1 if errors else 0)

[5] Run the verification script and test edge cases. First the real output table:

console
$ python run/verify_qa_en.py run/chats.en.txt run/qa_scoring_en.out.txt60 items checked, 0 errors

The second run (qa_scoring_en_2.out.txt) also passed with 60 items and 0 errors. To check the script catches problems, five hand-edited copies of qa_scoring_en.out.txt were tested and all exited with 1 (not model output): (1) one quote replaced by an invented sentence, (2) one quote replaced by the customer's line, (3) the 42 rows of CHAT-004 to CHAT-010 deleted, (4) one row duplicated, (5) baseline CHAT-002 CHK-02 changed to 1. An earlier version of the script passed (2) and (3), so it was rewritten. Cases (2) and (3) are shown.

console
$ python run/verify_qa_en.py run/chats.en.txt run/bad_en_customer_quote.txtMISS CHAT-001 CHK-01: quote not inside one agent turn 'My current phone bill feels to'60 items checked, 1 errors$ python run/verify_qa_en.py run/chats.en.txt run/bad_en_missing_rows.txtABSENT CHAT-004 CHK-01…18 items checked, 42 errors

[6] Where it falls short.

1. Quote span differs between runs: In the two English runs 9 of the 60 quotes differed (for example CHAT-001 CHK-02 and CHK-05), while the CHK-06 quote of CHAT-001 was the same in both. The Korean runs differed in 6 quotes, all CHK-06: for CHAT-001 run 1 quoted two sentences and run 2 only the question. Adding "quote only the single sentence that meets the item" to the prompt may even the length out, but this was not tried. 2. Department transfer: In CHAT-010 the agent only routed the customer to another team without describing a plan. All four runs (two Korean, two English) scored CHK-04 as 0. A run that mistook the transfer for a plan recommendation did not occur here, so whether an exception clause is needed was not tested.

#qa-scorecard#customer-support#prompt#claude