` gets a CSS class representing relevance heat colour (green → yellow → red). + • Tooltip or badge with numerical score + sentiment label. + +7. **Deployment** + • Put the bot and the web server in a single `uvicorn` process (FastAPI) or separate processes. + • Create a `systemd` service file pointing to `python -m mybot`. Enable & start. + +--- + +## 4. Notes & alternatives + +• Instead of custom relevance logic you could leverage an LLM prompt: + “Rate how relevant this paragraph is to the headline on a 0-10 scale.” + but embedding similarity is cheaper and deterministic. + +• If you prefer an “orchestration” layer, **LangChain** or **Haystack** can chain fetch → clean → embed → rank, but for a small tool plain code is simpler. + +• On CPU-only servers MiniLM embedding ≈ 1 ms per paragraph; RoBERTa sentiment ≈ 10 ms. Plenty fast unless you stream hundreds of articles per minute. + +• Store raw HTML too; you can later tweak parsing without re-downloading. + +• Add caching to avoid re-processing the same URL. + +--- + +## 5. Next steps + +1. Spin up a Python 3.11 virtual environment, install: + `pip install discord.py[voice] httpx trafilatura sentence-transformers scipy transformers torch fastapi uvicorn[standard]` + (Adjust optional GPU / CPU extras.) + +2. Prototype the article pipeline offline with a sample URL. + +3. Wire the pipeline into the Discord listener. + +4. Build the simple Flask / FastAPI template for visualisation. + +Once you have each module working in isolation, glue them together and harden (logging, error handling, retries). The entire MVP can fit comfortably in <500 lines of Python. + +Feel free to ask for deeper dives into any individual piece. Good luck with your project! + +kotlin.Unit +