Skip to course content
Free generative AI app course

Generative AI Application Development with Python

Unit 08.03: Summaries that lose the qualifier

Compression is where qualifiers go, and a summary that lost one is a different policy.

Counting the conditions that survived

One source sentence with three qualifiers, summarised three ways.

The code counts which survive.

SOURCE = ("Refunds are allowed within 7 days of purchase, for individual "
          "plans only, provided the item is unopened.")
QUALIFIERS = ["individual", "unopened", "7 day"]

SUMMARIES = {
    "faithful": "Individual plans can be refunded within 7 days if unopened.",
    "short":    "Refunds are allowed within 7 days.",
    "shortest": "Refunds are available.",
}
print(f"{'summary':10} {'qualifiers kept':>16}  text")
for name, text in SUMMARIES.items():
    kept = sum(q.lower() in text.lower() for q in QUALIFIERS)
    print(f"{name:10} {kept}/{len(QUALIFIERS):<14} {text}")

# Compression is where qualifiers go. The 'short' version is a sentence a
# customer would act on and it has dropped two conditions -- so it is not a
# shorter version of the policy, it is a different policy.

The 'short' summary is a sentence a customer would act on, and it has dropped two conditions. It is not a shorter version of the policy; it is a more generous one, stated with the same authority.

Counting qualifiers mechanically is crude and cheap. It runs on every summary and catches the case where brevity removed a limit.

The mistake this prevents

The mistake is judging summaries by readability. The shorter one always reads better, and the qualifiers are exactly what makes prose feel cluttered - so optimising for readability optimises for dropping them.

Takeaway

List the qualifiers that must survive and check for them mechanically. Brevity and accuracy pull in opposite directions when a statement has conditions.