Skip to main content

A Python package for calculating key metrics to assess LLM performance in various tasks, including extracting structured dataa.

Project description



LLMDataLens

PyPI version Python Versions

LLMDataLens is a powerful framework for evaluating LLM-based applications with structured output. It provides a flexible and extensible way to assess the performance of language models across various metrics.

Features

  • Evaluate LLM outputs against ground truth data
  • Customizable metrics for comprehensive performance assessment
  • Support for structured output evaluation
  • Easy integration with existing LLM pipelines
  • Extensible architecture for adding custom metrics and evaluators

Installation

You can install LLMDataLens directly from PyPI:

pip install llm-data-lens

For development or to get the latest version from the repository:

  1. Clone the repository:

    git clone https://github.com/codingmindset/LLMDataLens.git
    cd llmdatalens
    
  2. Install the package using Poetry:

    poetry install
    

Usage

Here's a basic example of how to use LLMDataLens:

from llmdatalens.evaluators import StructuredOutputEvaluator
from llmdatalens.core import LLMOutputData, GroundTruthData

# Create an evaluator with default metrics
evaluator = StructuredOutputEvaluator()

# Add LLM output and ground truth data
llm_output = LLMOutputData(
    raw_output="Processed invoice: $100",
    structured_output={"invoice_amount": 100}
)
ground_truth = GroundTruthData(
    data={"invoice_amount": 100}
)

evaluator.add_llm_output(llm_output, latency=0.5, confidence=0.9)
evaluator.add_ground_truth(ground_truth)

# Evaluate
result = evaluator.evaluate()

# Print results
print(result.metrics)

For more detailed examples, check the examples/ directory in the repository.

Documentation

(Comming soon!)

Project Structure

llmdatalens/
├── src/
│   └── llmdatalens/
│       ├── core/
│       │   ├── base_model.py
│       │   ├── enums.py
│       │   └── metrics_registry.py
│       └── evaluators/
│           └── structured_output_evaluator.py
├── tests/
│   ├── test_core/
│   └── test_evaluators/
├── examples/
├── pyproject.toml
└── README.md

Contributing

We welcome contributions to LLMDataLens! Here are some ways you can contribute:

  1. Report bugs or suggest features by opening an issue
  2. Improve documentation
  3. Submit pull requests with bug fixes or new features

Please read our Contributing Guidelines for more details.

License

LLMDataLens is released under the MIT License. See the LICENSE file for details.

Contact

If you have any questions or feedback, please open an issue on GitHub or contact the maintainers at elvin@codingmindset.io.

Citing LLMDataLens

If you use LLMDataLens in your research, please cite it as follows:

@software{llmdatalens,
  title = {LLMDataLens: A Framework for Evaluating LLM-based Applications},
  author = {Elvin Gomez},
  year = {2024},
  url = {https://github.com/codingmindset/LLMDataLens.git},
}

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

llm_data_lens-0.1.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

llm_data_lens-0.1.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file llm_data_lens-0.1.1.tar.gz.

File metadata

  • Download URL: llm_data_lens-0.1.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.5 Darwin/23.1.0

File hashes

Hashes for llm_data_lens-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3f1958a5371a604683924bc0358836d35aefe52659c54712cca94a0ea50780fa
MD5 dd83dd224692d260ba4962f6839e9af6
BLAKE2b-256 7297e7e18a6deaa89621aa6a8714e28626d31d14a75d8017c142fe6a959f2102

See more details on using hashes here.

File details

Details for the file llm_data_lens-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: llm_data_lens-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.5 Darwin/23.1.0

File hashes

Hashes for llm_data_lens-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 33e5a4d686bccb2813fe9d29bc51ce16d7fb5a2d6e98b91ca2ac78730e728ee5
MD5 35f28e9210a60a7fc487197dbb9e66ea
BLAKE2b-256 6a2b0cef650abc92fbef42bedaf5cec7c16e8c002c63a3c0d75f314bfb6c303e

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