CoolFace
Apppublic

rueckstiess/english-to-mql

sourceHugging Facemitupdated 3y agoView on Hugging Face
1likes
App README

English to MQL Translation with GPT-3.5

This is a basic demo app to show translation from English to MQL with language models like GPT-3.5 (model text-davinci-003).

Disclaimer: This app is experimental and for demo purposes only. We expect the results to be frequently incorrect at this early stage. Do not enter sensitive data, the inputs will be sent to OpenAI's APIs.

[image]

Requirements

You need Python version 3.7+ installed on your system and have an OpenAI API key.

Installation

Clone this repo and change into the sub-directory english-to-mql/.

(Optional) We recomment installing the dependencies in a local/virtual Python environment. You can create one with:

python -m venv .venv
source .venv/bin/activate

Now install the openai and streamlit packages and their dependencies.

pip install -r requirements.txt

Additionally, you need to create a Streamlit secrets file and add your OpenAI API key.

mkdir .streamlit
echo 'OPENAI_API_KEY = "REPLACE_WITH_KEY"' > .streamlit/secrets.toml

Running the app

To start the app, run

streamlit run app.py

This will start the Streamlit server and open a browser tab in your browser showing the application.

Usage

Enter an example document from your collection, which you can get from the mongosh shell with db.collection.findOne().

Then enter a question about the dataset in English and press 'Translate'.

The MQL aggregation pipeline should appear on the right-hand side.

Questions

For questions reach out in our #labs Slack channel.