Skip to content
Back to skills

Nli4pr Eval

ASecurity

Evaluates whether large language models can correctly determine clinical trial eligibility by performing natural language inference between patient profiles and trial criteria. It probes the model's ability to handle imprecise layman medical terminology compared to precise clinical language in a zero-shot setting. Use when the user wants to benchmark on NLI4PR, or asks about evaluating this task. Reports Macro F1.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 11, 2026
researchpythongogitperformance

Works with

  • cli

Security analysis

A100/100

Scanned September 11, 2026

npx -y skills add qhjqhj00/research-skills-pool --skill nli4pr-eval --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Nli4pr Eval?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Nli4pr Eval
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/qhjqhj00-nli4pr-eval/badge)](https://www.skillsdirectory.com/skills/qhjqhj00-nli4pr-eval)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: nli4pr-eval
description: Evaluates whether large language models can correctly determine clinical trial eligibility by performing natural language inference between patient profiles and trial criteria. It probes the model's ability to handle imprecise layman medical terminology compared to precise clinical language in a zero-shot setting. Use when the user wants to benchmark on NLI4PR, or asks about evaluating this task. Reports Macro F1.
metadata:
  skill_kind: dataset_eval
  source_arxiv: 2503.15718
  bibtex_key: [REDACTED]
  confidence: high
---

# nli4pr-eval

> Am I eligible? Natural Language Inference for Clinical Trial Patient Recruitment: the Patient's Point of View — Aguiar et al. (2025) (arXiv:2503.15718, 2025)

## What this evaluates

Evaluates whether large language models can correctly determine clinical trial eligibility by performing natural language inference between patient profiles and trial criteria. It probes the model's ability to handle imprecise layman medical terminology compared to precise clinical language in a zero-shot setting.

## Datasets

- **NLI4PR** — total ?; splits: test (-1); repo https://github.com/CTInfer/NLI4PR

## Metrics

- `Macro F1` **(primary)** — range: percent
  - Macro-averaged F1 score computed across all NLI classes. Calculated as the unweighted mean of the F1 scores for each class (Entailment, Contradiction, Neutral).

## Input / output format

**Input**: A prompt containing a patient profile (written in either lay/patient language or medical language) and clinical trial eligibility criteria, formatted using either a vanilla or persona template.

**Output**: A single NLI classification label indicating the relationship between the patient profile and the eligibility criteria (e.g., Entailment, Contradiction, Neutral).

## Scoring recipe

```python
def compute_macro_f1(predictions, gold_labels):
    classes = ['Entailment', 'Contradiction', 'Neutral']
    f1_scores = []
    for cls in classes:
        tp = sum(1 for p, g in zip(predictions, gold_labels) if p == cls and g == cls)
        fp = sum(1 for p, g in zip(predictions, gold_labels) if p == cls and g != cls)
        fn = sum(1 for p, g in zip(predictions, gold_labels) if p != cls and g == cls)
        prec = tp / (tp + fp) if (tp + fp) > 0 else 0.0
        rec = tp / (tp + fn) if (tp + fn) > 0 else 0.0
        f1 = 2 * prec * rec / (prec + rec) if (prec + rec) > 0 else 0.0
        f1_scores.append(f1)
    return sum(f1_scores) / len(f1_scores) * 100
```

## Common pitfalls

- Layman terms often lack the precision of medical terminology, making it difficult for models to match vague patient descriptions to strict eligibility criteria.
- Using a persona template does not consistently improve performance and can sometimes degrade it, particularly for smaller models like Flan-T5.
- The majority baseline assumes 'Entailment', which may skew expectations if the dataset is imbalanced or if the task is treated as binary rather than ternary.

## Evidence (verbatim from paper)

> Table 4 displays the results obtained by the models on the two types of templates. Table 4: Macro F1 score (in %) for the different baselines, using our different prompting templates in a zero-shot setting, on the test set. Lay is patient language, Med is medical doctor’s language, V stands for vanilla template and P stands for persona template. The majority baseline is Entailment.

## Citation

```bibtex
@misc{aguiar2025nli4pr,
  title={Am I eligible? Natural Language Inference for Clinical Trial Patient Recruitment: the Patient's Point of View},
  author={Aguiar et al. (2025)},
  year={2025},
  note={arXiv:2503.15718}
}
```

- arXiv: 2503.15718

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.