naver / sqlova

Apache License 2.0
632 stars 168 forks source link

add a prediction script #20

Closed paulfitz closed 5 years ago

paulfitz commented 5 years ago

Great model!

This adds a predict.py script to do inference with the model, predicting sql from questions without attempting to evaluate accuracy (which would require that the questions be labeled).

The train.py script is tweaked slightly so that the methods within it can be used by predict.py.

The annotate_ws.py script is also tweaked slightly so that it can be run on user data.

Two utilities, add_csv.py and add_question.py are added to give a quick way to set up some new tables and questions.

To minimize changes to existing code, I add unlabeled questions with a dummy label, as empty as I could make it while still having working code.

whwang299 commented 5 years ago

Hi @paulfitz

Thanks for the contribution! Before merge, I found some lines of code that may be omitted. Please let me know your opinion.

Thanks!

paulfitz commented 5 years ago

Thanks for the contribution! Before merge, I found some lines of code that may be omitted. Please let me know your opinion.

Thanks for reviewing! I've removed get_opt from predict.py and reverted train.py - thanks for spotting that, this is cleaner.