--- language: "en" tags: - neural-search-query-classification - neural-search widget: - text: " Player : text No. : text Nationality : text Position : text Years in Toronto : text School/Club Team : text What is terrence ross' nationality" --- ```python from transformers import BartTokenizer, BartForConditionalGeneration, BartConfig model = BartForConditionalGeneration.from_pretrained('shahrukhx01/schema-aware-distilbart-cnn-12-6-text2sql') tokenizer = BartTokenizer.from_pretrained('shahrukhx01/schema-aware-distilbart-cnn-12-6-text2sql') ## add NL query with table schema question = ' Player : text No. : text Nationality : text Position : text Years in Toronto : text \ School/Club Team : text What is terrence ross\' nationality' inputs = tokenizer([question], max_length=1024, min_length=0, return_tensors='pt') # Generate SQL text_query_ids = model.generate(inputs['input_ids'], num_beams=4, max_length=125, early_stopping=True) prediction = [tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=False) for g in text_query_ids][0] print(prediction) ```