Skip to main content
# bisheng-ragas: Evaluation framework for your Retrieval Augmented Generation (RAG) pipelines
## 快速开始
安装包
```bash
pip install -e .
```

评分
```python
import httpx
from datasets import Dataset
from langchain_openai import ChatOpenAI
from bisheng_ragas import evaluate
from bisheng_ragas.llms.langchain import LangchainLLM
from bisheng_ragas.metrics import AnswerCorrectnessBisheng

data_samples = {
'question': ['When was the first super bowl?', 'Who won the most super bowls?'],
'answer': [
'The first superbowl was held on Jan 15, 1967',
'The most super bowls have been won by The New England Patriots',
],
'ground_truths': [
['The first superbowl was held on January 15, 1967.'],
['The New England Patriots have won the Super Bowl a record six times'],
],
}
_llm = ChatOpenAI(model="gpt-4-turbo-2024-04-09",
http_client=httpx.Client(proxies=os.getenv('OPENAI_PROXY')),
http_async_client=httpx.AsyncClient(proxies=os.getenv('OPENAI_PROXY')),
temperature=temperature,
)
llm = LangchainLLM(_llm)
answer_correctness_bisheng = AnswerCorrectnessBisheng(llm=llm)

dataset = Dataset.from_dict(data_samples)
score = evaluate(dataset, metrics=[answer_correctness_bisheng])
print(score.to_pandas())
```
## 特别感谢

bisheng-ragas主要借鉴了以下仓库:
- https://github.com/explodinggradients/ragas 同步至v0.0.22(commit 41e9e54)

Metadata

Release files for bisheng-ragas 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for bisheng-ragas 1.0.3
File Interpreter ABI Platform Actions
bisheng_ragas-1.0.3-py3-none-any.whl Python 3 none any Details for bisheng_ragas-1.0.3-py3-none-any.whl

Release files / bisheng_ragas-1.0.3-py3-none-any.whl

Download URL bisheng_ragas-1.0.3-py3-none-any.whl
Size 71.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d4d350bb17149ebbb50ba45335f7093e4fb2b96228629c3aca885dcd01e5ee8
BLAKE2b-256 checksum
How to use checksums
2c4d8eadd68a6908c2a8398aef8f06c661335b4a8f7b8339de9f44698ea88a6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Security for bisheng-ragas 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page