agents.common.models.grade.qualitative¶
Qualitative grading model for text-based evaluations.
This module implements a qualitative grading system that provides text-based assessments with sentiment analysis and quality indicators.
Classes¶
Qualitative grading model for text-based evaluations. |
|
Quality levels for qualitative assessment. |
|
Sentiment types for qualitative feedback. |
Module Contents¶
- class agents.common.models.grade.qualitative.QualitativeGrade(/, **data)¶
Bases:
haive.agents.common.models.grade.base.Grade
Qualitative grading model for text-based evaluations.
This grade model provides detailed text-based assessments with quality levels, sentiment analysis, and structured feedback including strengths, weaknesses, and recommendations.
- Parameters:
data (Any)
- quality_level¶
Overall quality assessment
- sentiment¶
Sentiment of the feedback
- strengths¶
List of identified strengths
- weaknesses¶
List of identified weaknesses
- recommendations¶
List of improvement recommendations
- detailed_feedback¶
Extended qualitative feedback
Example
grade = QualitativeGrade( quality_level=QualityLevel.GOOD, sentiment=SentimentType.POSITIVE, strengths=[ "Clear logical structure", "Strong supporting evidence", "Engaging writing style" ], weaknesses=[ "Minor grammatical errors", "Could use more varied sentence structure" ], recommendations=[ "Proofread for grammatical accuracy", "Vary sentence length and structure for better flow" ], justification="Well-written piece with strong content but needs polish", detailed_feedback="This work demonstrates a solid understanding..." )
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- classmethod create_constructive_feedback(justification, strengths, weaknesses, recommendations, quality_level=QualityLevel.FAIR, **kwargs)¶
Create balanced constructive feedback.
- Parameters:
- Returns:
QualitativeGrade with balanced feedback
- Return type:
- classmethod create_positive_feedback(justification, strengths, minor_improvements=None, quality_level=QualityLevel.GOOD, **kwargs)¶
Create predominantly positive qualitative feedback.
- Parameters:
- Returns:
QualitativeGrade with positive sentiment
- Return type:
- generate_narrative_summary()¶
Generate a narrative summary of the qualitative assessment.
- Returns:
Human-readable narrative summary
- Return type:
- get_feedback_summary()¶
Get a structured summary of all feedback.
- get_improvement_priority()¶
Get prioritized improvement recommendations.
Returns top weaknesses with corresponding recommendations.
- get_normalized_score()¶
Get the grade as a normalized score between 0.0 and 1.0.
Based on quality level mapping to numeric equivalents.
- Returns:
Normalized score based on quality level
- Return type:
- is_passing(threshold=None)¶
Determine if the grade represents a passing score.
- to_display_string()¶
Convert grade to a human-readable display string.
- Returns:
Formatted string representation of the qualitative grade
- Return type:
- validate_feedback_consistency()¶
Validate that feedback is consistent with quality level.
- Returns:
Self if validation passes
- Raises:
ValueError – If feedback is inconsistent with quality level
- Return type:
- classmethod validate_feedback_items(v)¶
Validate that feedback items are meaningful.
- Parameters:
- Returns:
Validated list of feedback items
- Raises:
ValueError – If items are empty or too vague
- Return type:
- class agents.common.models.grade.qualitative.QualityLevel¶
-
Quality levels for qualitative assessment.
- EXCEPTIONAL¶
Outstanding quality, exceeds expectations
- EXCELLENT¶
High quality, meets all expectations
- GOOD¶
Satisfactory quality, meets most expectations
- FAIR¶
Adequate quality, meets basic expectations
- POOR¶
Below expectations, significant issues
- UNACCEPTABLE¶
Does not meet minimum standards
Initialize self. See help(type(self)) for accurate signature.
- class agents.common.models.grade.qualitative.SentimentType¶
-
Sentiment types for qualitative feedback.
- VERY_POSITIVE¶
Highly positive feedback
- POSITIVE¶
Generally positive feedback
- NEUTRAL¶
Balanced or neutral feedback
- NEGATIVE¶
Generally negative feedback
- VERY_NEGATIVE¶
Highly negative feedback
Initialize self. See help(type(self)) for accurate signature.