Skip to main content

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

If you're not sure about the file name format, learn more about wheel file names.

bisheng_ragas-1.0.3-py3-none-any.whl (71.8 kB view details)

Uploaded Python 3

File details

Details for the file bisheng_ragas-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: bisheng_ragas-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 71.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for bisheng_ragas-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3d4d350bb17149ebbb50ba45335f7093e4fb2b96228629c3aca885dcd01e5ee8
MD5 34de620e3f434dfbe54745a70e949035
BLAKE2b-256 2c4d8eadd68a6908c2a8398aef8f06c661335b4a8f7b8339de9f44698ea88a6f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page