Skip to main content

A Quick Llama Text2SQL Evaluation Library

Project description

A Quick Library for Llama Text2SQL Accuracy Evaluation

This library provides a simple interface for evaluating the accuracy of Llama models on the Text2SQL task. It uses the BIRD DEV dataset and provides a simple API for running the evaluation pipeline using the Llama API.

Quick Start

  1. Run pip install llama-text2sql-eval to install the library.

  2. Download the BIRD DEV dataset by running the following commands:

with-proxy wget https://bird-bench.oss-cn-beijing.aliyuncs.com/dev.zip
unzip dev.zip
rm dev.zip
rm -rf __MACOSX
cd dev_20240627
unzip dev_databases.zip
rm dev_databases.zip
rm -rf __MACOSX
cd ..
  1. Get your Llama API key here and set up an environment variable:
export LLAMA_API_KEY="your_key_here"
  1. Create a Python script and run it:
import os
from llama_text2sql_eval import LlamaText2SQLEval

evaluator = LlamaText2SQLEval()

results = evaluator.run(
    model="Llama-3.3-70B-Instruct", # or any other Llama models supported by the Llama API
    api_key=os.getenv("LLAMA_API_KEY")
)

if results:
    print(f"Overall Accuracy: {results['overall_accuracy']:.2f}%")
    print(f"Simple: {results['simple_accuracy']:.2f}%")
    print(f"Moderate: {results['moderate_accuracy']:.2f}%")
    print(f"Challenging: {results['challenging_accuracy']:.2f}%")

You should see something like:

Overall Accuracy: 57.95%
Simple: 65.30%
Moderate: 47.63%
Challenging: 44.14%

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

llama_text2sql_eval-0.0.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

llama_text2sql_eval-0.0.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file llama_text2sql_eval-0.0.1.tar.gz.

File metadata

  • Download URL: llama_text2sql_eval-0.0.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for llama_text2sql_eval-0.0.1.tar.gz
Algorithm Hash digest
SHA256 28859dc6342736b525f7e036130f08fae5d4befb85f3170113f7b6a2e6e584ef
MD5 7e16e8724b12df32330ca3a7052fdbec
BLAKE2b-256 a800c0dd67e4909c35b439d86355ce1608ad68503ed3560145ee6b312471834b

See more details on using hashes here.

File details

Details for the file llama_text2sql_eval-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_text2sql_eval-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f7c6b6383519413137e790fc37d9a616fb73ea4446bf4000260d9f080379b51c
MD5 336a8150398f33d5dd51b3cc072ddafb
BLAKE2b-256 dab88efafec9416ab5f0fde8f9c543ed0fc139d54da309b47ae928dfb293865e

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