Ask-a-Metric is a Text-2-SQL python package which helps you answer questions using information from databases.
Start with a fresh environment - either conda or venv.
Use Python 3.11.
git clone https://github.com/IDinsight/askametric
If you have conda, run the following:
conda install poetry
Else, run:
curl -sSL https://install.python-poetry.org | python3 -
Confirm Poetry installation by running:
poetry --version
Assuming we already have an environment set up:
poetry config virtualenvs.create false
And finally, install all the required packages:
poetry install
In the root directory, create a .env
file and add the following variables:
OPENAI_API_KEY=<your_openai_api_key>
Run Jupyter Notebook:
jupyter notebook
And open the demo.ipynb
file and run the cells to see the code in action!
Open and run the validation.ipynb
cells to see how to evaluate the responses from the pipeline for metrics like Relevancy, Consistenty, Accuracy, etc.
Note: This repository is a work-in-progress. We are continuously improving the code and documentation to help you use and further build on this code easily.