Language Learning Apps · Self-Directed Learners
Detect Subject-Verb Agreement Errors in Learner Text
Language learners frequently submit practice sentences containing subject-verb agreement errors. This example helps you decide whether to present an interactive grammar tip based on a Noul judgment. Application code checks the model judgment to route UI highlights to the learner.
Updated · Examples verified with jev-1.13.0
Interactive demo
Interactive Subject-Verb Agreement Radar
A interactive radar display evaluates learner text for subject-verb agreement errors, sweeping a dynamic needle across confidence bands and spawning visual indicator particles.
The visitor selects a sample practice sentence or types a custom foreign language line into a text field. Each run sends one live request to the public API; results are model judgments and can vary.
Verified sample results (4 inputs, jev-1.13.0)
Incorrect third-person singular agreement ('She go' instead of 'She goes').
{ "state": { "practice_text": "She go to the library every afternoon after class." }, "answers": { "agreement_rating": { "type": "score", "score": 0.22, "legend": { "0": "Severe subject-verb agreement mismatch", "1": "Minor or questionable agreement structure", "2": "Flawless subject-verb agreement" }, "confidence": 0.67, "probabilities": { "0": 0.79, "1": 0.2, "2": 0.01 } }, "has_agreement_error": { "noul": 0.95, "type": "noul" } } }Correct plural subject and auxiliary verb agreement.
{ "state": { "practice_text": "They have been studying French for three years." }, "answers": { "agreement_rating": { "type": "score", "score": 1.99, "legend": { "0": "Severe subject-verb agreement mismatch", "1": "Minor or questionable agreement structure", "2": "Flawless subject-verb agreement" }, "confidence": 0.98, "probabilities": { "0": 0, "1": 0.01, "2": 0.99 } }, "has_agreement_error": { "noul": 0.04, "type": "noul" } } }French subject-verb mismatch ('Le professeur expliquent' singular subject with plural verb).
{ "state": { "practice_text": "Le professeur expliquent la leçon aux étudiants attentivement." }, "answers": { "agreement_rating": { "type": "score", "score": 0.4, "legend": { "0": "Severe subject-verb agreement mismatch", "1": "Minor or questionable agreement structure", "2": "Flawless subject-verb agreement" }, "confidence": 0.41, "probabilities": { "0": 0.71, "1": 0.18, "2": 0.11 } }, "has_agreement_error": { "noul": 0.86, "type": "noul" } } }Correct first-person plural subject-verb agreement in Spanish.
{ "state": { "practice_text": "Nosotros escribimos una carta para el nuevo profesor." }, "answers": { "agreement_rating": { "type": "score", "score": 1.99, "legend": { "0": "Severe subject-verb agreement mismatch", "1": "Minor or questionable agreement structure", "2": "Flawless subject-verb agreement" }, "confidence": 0.98, "probabilities": { "0": 0, "1": 0.01, "2": 0.99 } }, "has_agreement_error": { "noul": 0.05, "type": "noul" } } }
The problem
The input consists of a single practice sentence written by a language learner. Because learners express ideas with varied vocabulary and sentence structures, simple pattern matching often misses agreement mismatches or flags false positives. The application must evaluate the sentence for subject-verb agreement errors so the learning interface can conditionally display a revision tip.
How TypeSafe helps
In the provided examples, the request submits a learner's input sentence in state and asks a single Noul question named has_agreement_error. The API returns a probability value indicating whether an agreement mistake is present, observed at 0.68 for an ungrammatical input ('The student write...'), 0.04 for a correct sentence ('The student writes...'), and 0.03 for a non-clause word ('Hello.'). Application code can compare this probability score against a custom threshold to decide when the learning interface should highlight the verb phrase and display a targeted revision tip. While the API provides the probability judgment, application code handles all threshold logic, UI highlights, and educational feedback policies.
- Input
- A single practice sentence written by a language learner.
- Decision
- Noul: Does the submitted sentence contain a subject-verb agreement error?
- Next action
- Learning UI highlights the verb phrase and displays a focused grammar tip.
Three verified examples
These responses were returned during a previous API verification. New probabilities can differ.
Sentence with subject-verb agreement error (primary)
Expected behavior: Elevated probability of an agreement error observed when the singular subject 'student' is paired with the base verb form 'write'.
Input
{
"sentence": "The student write a story every day."
}Previous verification response
jev-1.13.0 ·
{
"model": "jev-1.13.0",
"usage": {
"input_tokens": 346,
"output_tokens": 24
},
"answers": {
"has_agreement_error": {
"noul": 0.68,
"type": "noul"
}
}
}Grammatically correct sentence with matching subject and verb (alternative)
Expected behavior: Low probability of an agreement error because the singular subject 'student' correctly matches the third-person singular verb 'writes'.
Input
{
"sentence": "The student writes a story every day."
}Previous verification response
jev-1.13.0 ·
{
"model": "jev-1.13.0",
"usage": {
"input_tokens": 346,
"output_tokens": 24
},
"answers": {
"has_agreement_error": {
"noul": 0.04,
"type": "noul"
}
}
}Single word greeting without subject or verb (edge case)
Expected behavior: Low probability of a subject-verb agreement error because the single word greeting lacks a subject and verb clause.
Input
{
"sentence": "Hello."
}Previous verification response
jev-1.13.0 ·
{
"model": "jev-1.13.0",
"usage": {
"input_tokens": 340,
"output_tokens": 24
},
"answers": {
"has_agreement_error": {
"noul": 0.03,
"type": "noul"
}
}
}Try online
Start with a verified example, edit the request, then ask Jev. A live request is sent only when you press Try online.
Expected behavior: Elevated probability of an agreement error observed when the singular subject 'student' is paired with the base verb form 'write'.
Use non-sensitive test data. Live input goes to typesafe.pro and TypeSafe. Anonymous requests use the gateway’s free rate limit.
Probability that the answer is yes
Near 1 is a strong yes. Near 0 is a strong no. Around 0.5 means uncertainty. Noul has no separate confidence value.
import jsonfrom urllib.error import HTTPError, URLErrorfrom urllib.request import Request, urlopenBASE_URL = "https://api.typesafe.pro"payload = { "model": "jev-latest", "state": { "sentence": "The student write a story every day.", }, "questions": { "has_agreement_error": { "type": "noul", "criteria": { "true": "The subject and verb do not agree in number or person.", "false": "The subject and verb agree in number and person, or the text does not contain a subject-verb pair.", }, "instructions": "Determine if the sentence in state contains a subject-verb agreement error.", }, },}request = Request( f"{BASE_URL}/v1/systemone", data=json.dumps(payload).encode("utf-8"), headers={"Content-Type": "application/json"}, method="POST",)try: with urlopen(request, timeout=20) as response: result = json.load(response)except HTTPError as error: raise SystemExit(f"API returned HTTP {error.code}") from errorexcept URLError as error: raise SystemExit(f"Connection failed: {error.reason}") from errorprint(json.dumps(result["answers"], indent=2))Limitations and review
- This example evaluates a single Noul question focusing on subject-verb agreement, but this single-question design does not prevent you from evaluating other grammatical rules through separate questions in a multi-label workflow.
- The criteria for a false result cover both correct sentences and text lacking a subject-verb pair, so you can add separate questions if your UI needs to distinguish fragments from complete sentences.
- Observing an elevated agreement error score indicates text pattern issues in the provided sentence, but it does not perform automated spell-checking or validate learner lesson eligibility.
Set thresholds against your own examples before relying on an automated decision.