explodinggradients / ragas

Supercharge Your LLM Application Evaluations 🚀
https://docs.ragas.io
Apache License 2.0
7.3k stars 745 forks source link

Introduce epsilon in denominators to avoid division by zero #1622

Closed jltham closed 2 weeks ago

jltham commented 2 weeks ago

This only affects src/ragas/_topic_adherece.py.

Previously, it can be complicated to handle the score given by this metric due to possibility of division by zero. I propose to introduce an epsilon in the denominator to avoid that case.