PAI for RAG Evaluation
Project description
Pige——PAI for RAG Evaluation
from pige import critic_LLM, critic_Embedding, pige
API_KEY = "your llm api key"
base_url = "your llm server url"
model_name = "your model name"
llm = critic_LLM(api_key=API_KEY, base_url=base_url, model=model_name)
embedding_path = "your local embedding path"
embedding = critic_Embedding(model_path=embedding_path)
metrics = ['faithfulness', 'answer_relevancy', 'context_precision', 'context_recall']
data_samples = {
'question': ["What is the capital of France?"],
'contexts': [["Paris is the capital of France."]],
'answer': ["Paris"],
'ground_truth': ["Paris"]
}
res = pige(llm, embedding, data_samples, metrics)
Data Format
"question": List[str]
"context": List[List[str]]
"answer": List[str]
"ground_truth": List[str]
Output Format
The output of pige is a dataframe, you can use pandas to process it.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pige-0.0.1.tar.gz
(3.0 kB
view details)
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
pige-0.0.1-py3-none-any.whl
(3.0 kB
view details)
File details
Details for the file pige-0.0.1.tar.gz.
File metadata
- Download URL: pige-0.0.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b580386b722737a24b797e56ed9fb8b81030c417fad9432696319d50f835b795
|
|
| MD5 |
cb05e8c5e3fc3ef245bc95240a8967bf
|
|
| BLAKE2b-256 |
c5d691908c64daa263640a36dff2558acb4ce2e034ce68040d5b9c0f68a23afe
|
File details
Details for the file pige-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pige-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95b0f844511e25798214559c4b6cbdea446495e148085c2a4b131c8bcc73a753
|
|
| MD5 |
a31aeafa5748b325b312923eb42dae59
|
|
| BLAKE2b-256 |
c0632c1ce7128f844b5f692fdbcf924d17362c82ab1245a06e3cea2b0850e540
|