Skip to content

Fix heuristics for code execution instructions being flagged as negative - #221

Merged
jonathanpeppers merged 3 commits into
mainfrom
copilot/fix-220
Jul 30, 2025
Merged

Fix heuristics for code execution instructions being flagged as negative#221
jonathanpeppers merged 3 commits into
mainfrom
copilot/fix-220

Conversation

Copilot AI commented Jul 30, 2025

Copy link
Copy Markdown
Contributor

The ML model was incorrectly flagging legitimate code execution instructions as potentially problematic comments. Specifically, phrases like "Run `` several times" and "Run tests\Mono.Android-Tests\Mono.Android-Tests\Mono.Android.NET-Tests.csproj several times" were being classified as negative when they should be considered acceptable technical instructions.

Problem

  • "Run `` several times" was classified as IsNegative 1 (problematic) with confidence 0.717
  • Similar code execution instructions were also being misclassified
  • This created false positives for legitimate technical documentation and instructions

Solution

Added training data to help the model learn that code execution patterns are acceptable:

  • Added test cases with verbatim problematic text to onnxjs/tests/test_cases.json
  • Added 5 similar training examples to comments/classified.csv using the preprocessed format (#code replacement)
  • Rebuilt the model with the enhanced training data

Results

After the fix:

  • "Run `` several times" now correctly classifies as IsNegative 0 with confidence 0.725
  • "Run tests\Mono.Android-Tests\Mono.Android-Tests\Mono.Android.NET-Tests.csproj several times" classifies as IsNegative 0 with confidence 0.943
  • All 221 tests pass successfully
  • No regression in existing model performance

The model now properly recognizes code execution instructions as legitimate technical communication rather than problematic content.

Fixes #220.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits July 30, 2025 21:08
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Report sentence to improve heuristics Fix heuristics for code execution instructions being flagged as negative Jul 30, 2025
Copilot AI requested a review from jonathanpeppers July 30, 2025 21:12
@jonathanpeppers
jonathanpeppers marked this pull request as ready for review July 30, 2025 21:16
@jonathanpeppers
jonathanpeppers merged commit d0505bb into main Jul 30, 2025
4 checks passed
@jonathanpeppers
jonathanpeppers deleted the copilot/fix-220 branch July 30, 2025 21:17
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.

Report sentence to improve heuristics

2 participants