Metadata-Version: 2.4
Name: precis-summary
Version: 0.2.0
Summary: Fast extractive summarization via RAKE keyword extraction
Project-URL: Homepage, https://github.com/retospect/precis-summary
Project-URL: Repository, https://github.com/retospect/precis-summary
Author-email: Reto Stamm <reto@retostamm.com>
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Keywords: keyword-extraction,nlp,rake,summarization
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.11
Provides-Extra: dev
Requires-Dist: black>=24.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# precis-summary

Fast extractive summarization via RAKE keyword extraction. Zero dependencies.

## Usage

```python
from precis_summary import telegram_precis, pick_best_summary

# RAKE keyword extraction (~5ms, zero deps)
text = "Metal-organic frameworks exhibit high CO2 adsorption capacity..."
precis = telegram_precis(text)
# → "Metal-organic frameworks; high CO2 adsorption capacity; ..."

# Pick best summary from a multi-profile dict
summaries = {
    "rake": "Metal-organic frameworks; high CO2 adsorption",
    "llm:qwen3.5:9b": "MOFs show 3x CO2 uptake vs zeolites; amine-functionalized variants optimal",
}
best = pick_best_summary(summaries)
# → "MOFs show 3x CO2 uptake vs zeolites; amine-functionalized variants optimal"
```

## Summary ranking

`pick_best_summary()` uses prefix-priority matching:

1. `llm:*` — any LLM-generated summary (best quality)
2. `rake` — extractive RAKE keyphrases (instant, always available)
3. Fallback — first non-empty value

Ranking lives in code, not in the data. New summary methods are added by
extending `SUMMARY_PRIORITY` in `ranking.py`.
