Text to SQL translation example with Huggingface transformers
Retraining T5 base model with WikiSQL dataset on Kaggle’s NVIDIA TESLA P100 GPU
In this article, I closely follow up the detailed notebook from Manuel Romero with minor tweaks, such as replacing the T5 small model with the T5 base model (thus increasing the number of trainable parameters from 60M to about 223M). Full details of the analysis can be found in this public Kaggle notebook.
As a result of training during 5 epochs (taking about 2 hours of NVIDIA TESLA P100 GPU available for Kaggle users), the corresponding ROUGE2 Fscore is about 0.7904, or 2.86 percentage points higher than obtained in the initial notebook:
Some of the predicted examples of text-to-SQL translation performed by the trained model, together with the expected SQL queries:
translate to SQL: What is terrence ross' nationality
Predicted: SELECT Nationality FROM table WHERE Player = Terrence Ross
Expected: SELECT Nationality FROM table WHERE Player = Terrence Ross
translate to SQL: how many schools or teams had jalen rose
Predicted: SELECT COUNT School/Club Team FROM table…