No project description provided
Project description
# 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)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bisheng_ragas-1.0.2-py3-none-any.whl.
File metadata
- Download URL: bisheng_ragas-1.0.2-py3-none-any.whl
- Upload date:
- Size: 71.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
135b7adb12707eb6c9c0aa32e97c77e6dc80bd1e86769a0cf225c55359f45712
|
|
| MD5 |
660f0684b10cb1fa3956d8cdc583a077
|
|
| BLAKE2b-256 |
36600eb12014d7eaf46ec4257e8084b26daf20e4b954a1aee579eba39ba4bb1f
|