fix: FEDERAL_DEFLECTION could not see the participial state-subject form - #95
Merged
Merged
Conversation
REQ-0072, filed by zero-hour. The pattern required a copula:
\b(?:is|are)\s+(?:a|an)\s+[Ss]tate\s+[Ss]ubject\b
Indian legislative English drops it. "Agriculture being a State subject, there
is no investment in agriculture directly by the Central Government in the
States" matched nothing. The pattern now accepts `being`. It is one alternation.
Measured by zero-hour over 489,469 answered records. 3,080 answers use the
participle, 2,982 of those match no copula, and 518 carry no label from any
tier at all.
THIS MOVES A PUBLISHED NUMBER. Re-run `analyse-discourse` on any corpus, then
re-read every evasion rate computed from it.
Two kinds of record move, and only the first is pure recall. The 518 unlabelled
records gain the label, which raises both the evasive count and the classified
denominator. The other 2,464 already carry a label from another pattern, and
FEDERAL_DEFLECTION's 0.92 outranks it.
That precedence is not introduced here. The copula form already outranks
ACCEPTED and REJECTED today at the same confidence. This makes the participle
behave exactly as the copula does. Whether a state-subject clause should
outrank a substantive disclosure is a separate question, and it applies to the
shipped copula pattern first.
Three tests cover it. One carries the verbatim sentence with its source key.
One guards that the two forms agree on label and confidence. One checks that
copula matches do not move.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Delivers REQ-0072, filed by zero-hour today.
The defect
_FEDERAL_DEFLECTION's state-subject pattern required a copula:Indian legislative English drops it:
Reproduced before the change: that sentence returned
UNCLASSIFIEDat 0.0. The copula form returnedFEDERAL_DEFLECTIONat 0.92.The change
One alternation.
(?:is|are)becomes(?:is|are|being).Measured by zero-hour over 489,469 answered records
This moves a published number, and I checked which way
I diffed the classifier before and after, in two processes, over a spread of constructed cases. Acceptance 3 needs a caveat the request did not have.
Pure recall — the 518.
UNCLASSIFIED→FEDERAL_DEFLECTION. Raises the evasive count and the classified denominator.Not pure recall — the other 2,464. These already carry a label from another pattern, and
FEDERAL_DEFLECTION's 0.92 outranks it. Verified examples:ABSORBED(evasive)FEDERAL_DEFLECTIONACCEPTED(substantive)FEDERAL_DEFLECTIONREJECTED(substantive)FEDERAL_DEFLECTIONThat precedence is pre-existing and is not introduced here. I confirmed against the unmodified code that the copula form already outranks
ACCEPTEDandREJECTEDat 0.92. This change makes the participle behave exactly as the copula does — which is what the request asks for.A separate question falls out of it, and it belongs upstream of this PR: should a state-subject clause outrank a substantive disclosure at all? "Agriculture is a State subject, Government has approved Rs 500 crore and released the funds" reads
FEDERAL_DEFLECTIONtoday. That is the shipped copula pattern's behaviour, not this alternation's.Acceptance
classify_response("Agriculture being a State subject, ...", "qa")returnsFEDERAL_DEFLECTION.analyse-discourseas the re-run.Tests
509 passed, 1 skipped, 12 subtests. Three new tests: the verbatim sentence, a guard that participle and copula agree on label and confidence, and a check that copula matches do not move.