Code to implemnent a transformer model that converts natural text into SQL queries
This code implements a complete transformer model (encoder + decoder) with a multihead attention mechanism. This model was trained using the "Clinton Text-to-SQL v1." dataset and produces a generative SQL query that corresponds to the natural text query, with SQL context, that was input.
-
tokeniser.py - creates and trains sentencepiece tokeniser
-
dataset.py - implements tokenised dataset
-
decoder.py - implements transformer architecture
-
train.py - trains the transformer using Clinton Text-to-SQL v1 dataset
-
inference.py - generates output SQL query from input text and context
-
constants.py - lists all the constants used across the modules
Louis Chapo-Saunders