feat: Multi-Dimensional Quality Scoring for Structured Outputs#4
Open
a827681306 wants to merge 1 commit intoMint-Claw:mainfrom
Open
feat: Multi-Dimensional Quality Scoring for Structured Outputs#4a827681306 wants to merge 1 commit intoMint-Claw:mainfrom
a827681306 wants to merge 1 commit intoMint-Claw:mainfrom
Conversation
Implements a scoring engine that evaluates structured submissions (JSON, markdown, code, text) across 5 weighted dimensions: - Completeness (0.30): required fields, sections, min length - Format Compliance (0.20): format detection, structure quality - Coverage (0.25): keyword matching, vocabulary diversity - Clarity (0.15): sentence length, repetition, readability - Validity (0.10): JSON schema, bracket balance, syntax checks Features: - Auto-detect content format (JSON/markdown/code/text) - Weighted 0-1 score with quality rating - Per-dimension feedback with NLP summary generation - Batch scoring: 100 submissions in <0.2s - Configurable weights and pass thresholds - 35 test cases covering all formats and edge cases Closes Mint-Claw#1
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.
Summary
Implements a multi-dimensional quality scoring engine for structured submissions (JSON, markdown, code, text), addressing issue #1.
Architecture
scorer.py— Pure Python, zero external dependencies. Two main classes:QualityScorer— Entry point. Configurable weights, pass threshold. Supports single and batch scoring.Rubric— Defines expectations: required fields, expected format, keywords, JSON schema, etc.Auto-format detection via regex heuristics for JSON, markdown, code, and plain text.
Scoring Dimensions
Output Format
{ "weighted_score": 0.8725, # 0-1 weighted aggregate "quality_rating": "good", # excellent/good/acceptable/poor/failing "scores": { # per-dimension breakdown "completeness": 0.95, "format_compliance": 0.90, "coverage": 0.80, "clarity": 0.85, "validity": 1.0 }, "feedback": ["..."], # actionable per-dimension feedback "pass_threshold": true, # meets minimum bar "detected_format": "json" }Bonus: NLP Feedback Generation
generate_nlp_feedback()produces a natural-language summary identifying strongest/weakest dimensions and priority improvements.Performance
Test Coverage
35 test cases in
test_scorer.pycovering:Design Decisions
_DIMENSION_SCORERS.score_batch()designed for bulk evaluation pipelines.Closes #1