microsoft / rat-sql

A relation-aware semantic parsing model from English to SQL
https://arxiv.org/abs/1911.04942
MIT License
406 stars 117 forks source link

Do you have notebook version for RATSQL ? #56

Open toreleon opened 3 years ago

toreleon commented 3 years ago

I would like to run RATSQL but my laptop isn't enough for training. Can you help me to setup the run on Google colab ?

alan-ai-learner commented 3 years ago

https://github.com/DevanshChoubey/rat-sql/blob/master/RatSql.ipynb try this and let me know if you run it successfully

unknowed-ER commented 3 years ago

@alan-ai-learner I follow this ,but when I run python run.py preprocess experiments/spider-bert-run.jsonnet ,I can’t connection to CoreNLP like this

WARNING <class 'ratsql.models.enc_dec.EncDecModel.Preproc'>: superfluous {'name': 'EncDec'}

DB connections: 100%|██████████████████████████████████████████████████████████████████| 166/166 [00:00<00:00, 396.42it/s] train section: 0%| | 0/8659 [00:00<?, ?it/s] WARNING: CoreNLP connection timeout. Recreating the server... train section: 0%| | 0/8659 [00:30<?, ?it/s] Traceback (most recent call last): File "/home/fsx/model/rat-sql/ratsql/resources/corenlp.py", line 28, in annotate result = self.client.annotate(text, annotators, output_format, properties) File "/home/fsx/anaconda3/envs/torch1.6/lib/python3.7/site-packages/corenlp/client.py", line 225, in annotate r = self._request(text.encode('utf-8'), properties) File "/home/fsx/anaconda3/envs/torch1.6/lib/python3.7/site-packages/corenlp/client.py", line 178, in _request self.ensure_alive() File "/home/fsx/anaconda3/envs/torch1.6/lib/python3.7/site-packages/corenlp/client.py", line 119, in ensure_alive raise PermanentlyFailedException("Timed out waiting for service to come alive.") corenlp.client.PermanentlyFailedException: Timed out waiting for service to come alive.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "run.py", line 108, in main() File "run.py", line 73, in main preprocess.main(preprocess_config) File "/home/fsx/model/rat-sql/ratsql/commands/preprocess.py", line 53, in main preprocessor.preprocess() File "/home/fsx/model/rat-sql/ratsql/commands/preprocess.py", line 32, in preprocess to_add, validation_info = self.model_preproc.validate_item(item, section) File "/home/fsx/model/rat-sql/ratsql/models/enc_dec.py", line 36, in validate_item enc_result, enc_info = self.enc_preproc.validate_item(item, section) File "/home/fsx/model/rat-sql/ratsql/models/spider/spider_enc.py", line 719, in validate_item preproc_schema = self._preprocess_schema(item.schema) File "/home/fsx/model/rat-sql/ratsql/models/spider/spider_enc.py", line 734, in _preprocess_schema self.fix_issue_16_primary_keys, bert=True) File "/home/fsx/model/rat-sql/ratsql/models/spider/spider_enc.py", line 78, in preprocess_schema_uncached r.normalized_column_names.append(Bertokens(col_toks)) File "/home/fsx/model/rat-sql/ratsql/models/spider/spider_enc.py", line 552, in init self.normalize_toks() File "/home/fsx/model/rat-sql/ratsql/models/spider/spider_enc.py", line 603, in normalize_toks ann = corenlp.annotate(tok, annotators=['tokenize', 'ssplit', 'lemma']) File "/home/fsx/model/rat-sql/ratsql/resources/corenlp.py", line 46, in annotate return _singleton.annotate(text, annotators, output_format, properties) File "/home/fsx/model/rat-sql/ratsql/resources/corenlp.py", line 34, in annotate result = self.client.annotate(text, annotators, output_format, properties) File "/home/fsx/anaconda3/envs/torch1.6/lib/python3.7/site-packages/corenlp/client.py", line 225, in annotate r = self._request(text.encode('utf-8'), properties) File "/home/fsx/anaconda3/envs/torch1.6/lib/python3.7/site-packages/corenlp/client.py", line 178, in _request self.ensure_alive() File "/home/fsx/anaconda3/envs/torch1.6/lib/python3.7/site-packages/corenlp/client.py", line 119, in ensure_alive raise PermanentlyFailedException("Timed out waiting for service to come alive.") corenlp.client.PermanentlyFailedException: Timed out waiting for service to come alive.

Could you kown how to fix it?my java version is openjdk 1.8.0

alan-ai-learner commented 3 years ago

hey @unknowed-ER , I haven't use this now, due to some bugs, try smbop, which is great for text2sql task, with better implementations.

unknowed-ER commented 3 years ago

@alan-ai-learner ,thanks for your response , i'll try smbop .

alan-ai-learner commented 3 years ago

@alan-ai-learner ,thanks for your response , i'll try smbop .

👍