Skip to content

Fix: Preserve filtered components in scoring logic - #1

Merged
prathameshfuke merged 1 commit into
mainfrom
version-2
May 4, 2026
Merged

prathameshfuke merged 1 commit into
mainfrom
version-2

Conversation

@gauravvaru

@gauravvaru gauravvaru commented May 4, 2026 •

Copy link
Copy Markdown
Collaborator
  • Removed duplicate reassignment of components in scoring.py
  • Ensured filtered components_list is preserved
  • Improves data quality for LLM scoring

This fix prevents overwriting of cleaned component data, leading to more accurate evaluation.

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced data validation in the tender scoring and matching process to automatically filter out empty or malformed deliverables and technical specifications, ensuring only valid, high-quality data is processed for more accurate and reliable tender matching recommendations.

Copilot AI review requested due to automatic review settings May 4, 2026 14:20
@coderabbitai

coderabbitai Bot commented May 4, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a2349010-d0c1-4727-9fd8-e0e832d5e6dc

📥 Commits

Reviewing files that changed from the base of the PR and between e87f52a and 1fa11c1.

📒 Files selected for processing (1)
  • tender_extraction/scoring.py

📝 Walkthrough

Walkthrough

The score_tender_match function now sanitizes tender data before building LLM prompts by filtering deliverables to non-empty strings (max 5) and technical specifications to entries with non-empty component strings (max 10), replacing permissive list slicing with explicit filtering.

Changes

Prompt Data Sanitization

Layer / File(s) Summary
Core Logic
tender_extraction/scoring.py
score_tender_match filters scope_of_work["deliverables"] to include only non-empty strings (capped at 5) and technical_specifications to include only dicts with non-empty "component" fields (capped at 10), replacing permissive list slicing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 The tender rolls in, but some parts are hollow,
Now we filter the noise that LLMs would follow,
Empty strings begone, components must gleam—
Cleaner prompts build a more accurate dream!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix: Preserve filtered components in scoring logic' accurately describes the main change: preventing overwriting of cleaned component data in the scoring logic.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch version-2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens the prompt-preparation step in tender_extraction.scoring so the LLM scoring summary uses cleaned tender data instead of passing through blank or malformed deliverables/components. In the broader pipeline, that improves the quality of the extracted context sent into match scoring.

Changes:

  • Filters scope_of_work.deliverables down to non-empty strings before joining them into the prompt.
  • Filters technical_specifications[*].component down to non-empty stripped strings before building the component summary.
  • Preserves the cleaned component list when constructing the tender summary used by scoring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@prathameshfuke
prathameshfuke merged commit 175fd61 into main May 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants