uma_filter
Reduce retrieved context to relevant sentences for a query. Uses a cross-encoder to score sentence relevance, keeps those above a threshold, and returns trimmed context with metrics.
Instructions
Filter retrieved context down to sentences relevant to a query.
Runs sentence segmentation, then a local cross-encoder
(cross-encoder/ms-marco-MiniLM-L-6-v2 by default) to score every
sentence's relevance to the query, keeps sentences scoring at or above
threshold (0-1, default 0.5), optionally trims to max_tokens, and
returns the filtered context along with real measured metrics.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| context | Yes | ||
| threshold | No | ||
| max_tokens | No |