ver : 2.0.0
https://www.overleaf.com/project/696e0a579a7cced1f4889de3
This project is a small student tool for the LLM4SE A3 assignment: Analysing Software Requirements Through Abstractions.
It extracts abstraction spans from requirements using a local LLM via Ollama, renders them as HTML highlights, and evaluates predictions against a gold annotation.
One LLM call per requirement. The model extracts all tags at once.
A workflow that follows the course slide idea (multi‑step / multi‑agent):
- Segmenter Agent (pre‑processing): splits the requirement into clause‑like segments.
- Entities Agent:
Entity,Main_actor - Actions Agent:
Action,System_response - Logic Agent:
Condition,Precondition,Trigger - Purpose Agent:
Purpose
Purpose, Trigger, Precondition, Condition, Action, System_response, Entity, Main_actor
For the main comparison we ignore character offsets and evaluate only the extracted (tag, span_text) pairs.
Offsets (start/end) are computed only to render HTML highlights.
This makes the baseline vs multi‑agent comparison focus on tagging / extraction quality, not on character index counting.
- Python 3.10+
- Ollama installed and running (default
http://localhost:11434)
pip install -r requirements.txtCopy .env.example to .env and edit if needed:
cp .env.example .envKey settings:
OLLAMA_MODEL(e.g.,qwen3:4b-instruct,llama3.1:8b-instruct, etc.)- prompt variants:
REQFLOW_DEFAULT_BASELINE_VARIANT=zero|one|fewREQFLOW_DEFAULT_PIPELINE_VARIANT=zero|one|few
python cli.py baseline --variant one --ids 1,2,3,4,5python cli.py pipeline --variant one --ids 1,2,3,4,5Each run writes:
- a JSON prediction file
- an HTML visualization file (same name,
.html)
python evaluate.py --pred results/run_*/pipeline_one.json --gold data/gold.json --out results_eval.csvpython reqflow.pyColumns:
id(int)text(string) Other columns (likenested,type, etc.) are allowed and ignored.
List/dict format is supported; each item has:
idtextspans: objects like{ "tag": "...", "text": "...", "start": ..., "end": ... }
Same structure as gold, but start/end are optional and only used for HTML rendering.
- Prefer
oneorfewvariants for better copy‑exact behavior. - If the model starts paraphrasing, increase strictness in prompts (already done in provided prompts).
