| title | SciSum-Qwen |
|---|---|
| colorFrom | blue |
| colorTo | indigo |
| sdk | gradio |
| app_file | hf_space_app.py |
| python_version | 3.12 |
| pinned | false |
Faithful long-document scientific paper summarization with Qwen2.5-3B-Instruct, QLoRA, hierarchical section-aware inference, and claim-level evidence support scoring.
- Public app: mokarami-scisum-qwen.hf.space
- Public Space repo: huggingface.co/spaces/mokarami/scisum-qwen
- Public deployment validation: reports/public_space_validation.md
You give the system a long scientific paper. It:
- parses section-aware paper structure
- handles long inputs with hierarchical summarization
- generates a structured scientific summary
- retrieves evidence for summary claims
- scores how well claims are supported by the source text
- serves the workflow through a FastAPI layer, a polished Gradio demo, and a public Hugging Face Space
- It is not only a prompt wrapper around a hosted model.
- It includes a real
QLoRA-adapted scientific summarization model. - It handles long-document structure instead of naive truncation.
- It exposes claim-level evidence support instead of only returning text.
- It includes tracked evaluation artifacts, a shipped adapter, and a deployed public demo.
flowchart TD
A["Scientific Paper Text"] --> B["Section Parsing"]
B --> C["Hierarchical Section Summaries"]
C --> D["Structured Final Summary"]
D --> E["Claim Extraction"]
A --> F["Section-Aware Chunks"]
E --> G["Evidence Retrieval"]
F --> G
G --> H["Support Scoring"]
D --> I["FastAPI / Gradio Output"]
H --> I
The adapter-backed local service was smoke-tested successfully:
GET /healthreturned200GET /model-inforeturned200POST /summarizereturned200POST /evidence-supportreturned200- the local summary backend reported
qwen-backed generation
Relevant code:
The public Hugging Face Space was tested end-to-end after deployment:
- public app returned
HTTP 200 - public Gradio API exposed
/run_demo - end-to-end prediction completed successfully
- validation details are recorded in reports/public_space_validation.md
The public Space runs on constrained cpu-basic hardware, so response latency and backend behavior can differ from local adapter-backed inference. The local API validation above is the stronger proof for the trained artifact path.
- Trained adapter:
- Colab run outputs:
- Public deployment proof:
A stronger paper-like demo sample is included here:
scisum-qwen/
├── app/ # polished Gradio UI
├── colab/ # Colab notebook for heavy runs
├── configs/ # training / inference / eval configs
├── data/ # sample inputs and processed subsets
├── models/ # tracked QLoRA adapter artifacts
├── reports/ # evaluation, experiment, and validation outputs
├── scripts/ # deploy, smoke-test, packaging helpers
├── src/scisum_qwen/ # core package
└── tests/ # unit and smoke-level tests
src/scisum_qwen/api/service.py- orchestration layer for summarization and evidence support
src/scisum_qwen/inference/generator.py- model-backed inference with adapter loading
src/scisum_qwen/inference/hierarchical.py- section-aware hierarchical summarization logic
src/scisum_qwen/evidence/support_scorer.py- claim-level evidence support scoring
app/gradio_app.py- public demo application
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .
pytestUseful commands:
make baseline
make evaluate
make compare
make errors
make evidence
make api
make demo
make test-public-spacePYTHONPATH=src .venv/bin/python scripts/smoke_test_api.pyPublic demo check:
.venv/bin/python scripts/test_public_space.pyRun the local API:
make apiSend a structured summarization request:
bash examples/curl_summarize.shReference payload:
Public deployment target used for this project:
- Hugging Face Spaces with
Gradio
Deploy script:
HF_TOKEN=... .venv/bin/python scripts/deploy_hf_space.py --repo-id mokarami/scisum-qwenAlternative product path:
FastAPI+ Docker viaDockerfileandrender.yaml
- GitHub Actions CI:
.github/workflows/ci.yml - Citation metadata:
CITATION.cff
- The tracked experiment metrics come from a reduced subset run, not a full-scale final benchmark.
- Claim support scoring estimates grounding but does not formally prove factual correctness.
- Public Space inference on
cpu-basicis slower and less representative than local hardware-backed model execution.
Built a faithful long-document scientific paper summarization system using Qwen2.5-3B-Instruct and QLoRA, combining section-aware hierarchical inference, claim-level evidence retrieval, tracked evaluation artifacts, a shipped trained adapter, a FastAPI backend, and a publicly deployed Hugging Face Space demo.