Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

A float-scale aggregate drops rationale-less constituents from its rationale

Đang mở Phù hợp với người mới
#2,880 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu trong pyrit/score/float_scale/float_scale_score_aggregator.py, so sánh nhánh rationale đã lọc với _undetermined_result và true_false_score_aggregator._build_rationale. Kiểm tra format_score_for_rationale và docstring của FloatScaleThresholdScorer, sau đó thêm coverage cho các constituent không có rationale; hoàn thành khi mọi constituent đều được biểu diễn nhất quán trong một rationale float-scale gồm nhiều constituent.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

When a float-scale aggregate combines more than one constituent, the constituents without a rationale disappear from the rationale entirely.

In pyrit/score/float_scale/float_scale_score_aggregator.py:

else:
    description = aggregate_description
    # Only include scores with non-empty rationales
    rationale_parts = [format_score_for_rationale(s) for s in scores if s.score_rationale]
    rationale = "\n".join(rationale_parts) if rationale_parts else ""

Two things in the same package say the opposite. format_score_for_rationale — the formatter being called — is built to render a line for a rationale-less score (f" - {class_type} {value}: {score.score_rationale or ''}"), and its docstring describes the value and the rationale as what a line carries. The other two rationale builders do not filter: the undetermined branch of this same file (_undetermined_result) and true_false_score_aggregator._build_rationale both pass every constituent through.

The scorer that makes this visible is one this repository already documents: FloatScaleThresholdScorer's own docstring notes that AzureContentFilterScorer "routinely does not" supply a rationale. A multi-chunk or multi-category Azure filter aggregate therefore persists score_rationale == "" — the score is right, but nothing records what was aggregated or that there was more than one constituent, while the same run's true/false aggregates list theirs.

Proposal: drop the filter, so the float-scale rationale matches its two siblings. If the filter is deliberate, the alternative is to keep it and say so in the output (for example a trailing "N constituent(s) had no rationale"), so an empty rationale is distinguishable from a single-component one.

Happy to send the one-line change plus tests either way — I did not want to just delete a line that was written on purpose without asking.

Ngôn ngữ chính
Python
Star
4.5k
Fork
896
Merge trung bình
3 ngày 1 giờ
Pull request đã merge (30 ngày)
208

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/PyRIT

Tất cả issue của microsoft/PyRIT

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.