Skip to main content

llama-index packs llama_dataset_metadata integration

Project description

LlamaDataset Metadata Pack

As part of the LlamaDataset submission package into llamahub, two metadata files are required, namely: card.json and README.md. This pack creates these two files and saves them to disk to help expedite the submission process.

CLI Usage

You can download llamapacks directly using llamaindex-cli, which comes installed with the llama-index python package:

llamaindex-cli download-llamapack LlamaDatasetMetadataPack --download-dir ./llama_dataset_metadata_pack

You can then inspect the files at ./llama_dataset_metadata_pack and use them as a template for your own project!

Code Usage

You can download the pack to the ./llama_dataset_metadata_pack directory through python code as well. The sample script below demonstrates how to construct LlamaDatasetMetadataPack using a LabelledRagDataset downloaded from llama-hub and a simple RAG pipeline built off of its source documents.

from llama_index.core.llama_pack import download_llama_pack

# Download and install dependencies
LlamaDatasetMetadataPack = download_llama_pack(
    "LlamaDatasetMetadataPack", "./llama_dataset_metadata_pack"
)

# construction requires a query_engine, a rag_dataset, and optionally a judge_llm
llama_dataset_metadata_pack = LlamaDatasetMetadataPack()

# create and save `card.json` and `README.md` to disk
dataset_description = (
    "A labelled RAG dataset based off an essay by Paul Graham, consisting of "
    "queries, reference answers, and reference contexts."
)

llama_dataset_metadata_pack.run(
    name="Paul Graham Essay Dataset",
    description=dataset_description,
    rag_dataset=rag_dataset,  # defined earlier not shown here
    index=index,  # defined earlier not shown here
    benchmark_df=benchmark_df,  # defined earlier not shown here
    baseline_name="llamaindex",
)

NOTE: this pack should be used only after performing a RAG evaluation (i.e., by using RagEvaluatorPack on a LabelledRagDataset). In the code snippet above, index, rag_dataset, and benchmark_df are all objects that you'd expect to have only after performing the RAG evaluation as mention in the previous sentence.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

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

File details

Details for the file llama_index_packs_llama_dataset_metadata-0.4.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_packs_llama_dataset_metadata-0.4.0.tar.gz
Algorithm Hash digest
SHA256 04366d7067f26eb216f8e0a2dc3947805112828dc3c82ce6b8afde95d7c7fa66
MD5 3c7cda28a864ff62a8f51f3aad44643b
BLAKE2b-256 598bbfa62a0f9cdeae64a7ce3e6fda57c0d23747fc987479e07cd06ec8effd1f

See more details on using hashes here.

File details

Details for the file llama_index_packs_llama_dataset_metadata-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_packs_llama_dataset_metadata-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6965c0cfc6cf07a3c4864de0ef2c4b5c8952dceda6f92bc5e0856a27d95f75df
MD5 ee35a7d6e2a08f72caf3ac8d4dedb2ca
BLAKE2b-256 be4da558dc7c3d27d21ec1d08f84bb199b4e41ecf0eeaf728b03f1d3ebd079c0

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