Skip to content

Assessment Prefilter: Enable TR for Attachments #953

@vprashrex

Description

@vprashrex

Is your feature request related to a problem?
In the assessment prefilter, topic relevance (TR) is not activated when only attachment columns are used. This limitation leads to skipping important topic relevance filtering when no text columns are present.

Describe the solution you'd like

  • Modify the TR enabling condition to include both text columns and attachment columns.
  • The condition should check if either one of the columns is configured along with a prompt.
Original issue

Describe the bug

In the assessment prefilter, topic relevance (TR) is only enabled when text columns and a prompt are configured. If a TR config uses only attachment_columns (e.g. an answer sheet) with no text columns, tr_enabled resolves to False and topic relevance filtering is silently skipped.

backend/app/services/assessment/prefilter/pipeline.pyresolve_prefilter_settings:

"tr_enabled": bool(tr_columns and tr_prompt),

Here attachment_columns is not considered, so attachment-only configs never enable TR.

Expected behavior

TR should be enabled when either text columns or attachment_columns are present, as long as a prompt is set.

Steps to reproduce

  1. Configure a prefilter with topic_relevance.attachment_columns = ["Answer Sheet"], topic_relevance.columns = [], and a non-empty prompt.
  2. Run the prefilter pipeline.
  3. Observe tr_enabled is False and topic relevance is skipped.

Proposed fix

Enable TR when either column source is present:

"tr_enabled": bool((tr_columns or tr_attachment_columns) and tr_prompt),

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No fields configured for Task.

Projects

Status
Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions