(tables, wv, idx_w2i, n_total, w2i, wemb)
return idx_w2i, n_total
Generate subset of GloVe
        update_w2i_wemb. It uses wv, w2i, wemb, idx_w2i as global variables.

        To do
        1. What should we do with the numeric?
Generate subset of GloVe
        update_w2i_wemb. It uses wv, w2i, wemb, idx_w2i as global variables.
Generate subset of GloVe update_w2i_wemb . It uses wv w2i wemb idx_w2i as global variables .
def generate_w2i_wemb_table(tables, wv, idx_w2i, n_total, w2i, wemb):
    """ Generate subset of GloVe
        update_w2i_wemb. It uses wv, w2i, wemb, idx_w2i as global variables.

        To do
        1. What should we do with the numeric?
    """
    # word_set from NL query
    for table_id, table_contents in tables.items():

        # NLq = t1['question']
        # word_tokens = NLq.rstrip().replace('?', '').split(' ')
        headers = table_contents['header_tok'] # [ ['state/terriotry'], ['current', 'slogan'], [],
        for header_tokens in headers:
            for token in header_tokens:
                idx_w2i, n_total = update_w2i_wemb(token, wv, idx_w2i, n_total, w2i, wemb)
                # WikiSQL generaets unbelivable query... using state/territory in the NLq. Unnatural.. but as is
                # when there is slash, unlike original SQLNet which treats them as single token, we use
                # both tokens. e.g. 'state/terriotry' -> 'state'
                # token_spl = token.split('/')
                # for token_spl1 in token_spl:
                #         idx_w2i, n_total = update_w2i_wemb(token_spl1, wv, idx_w2i, n_total, w2i, wemb)

    return idx_w2i, n_total
def generate_w2i_wemb_table ( tables , wv , idx_w2i , n_total , w2i , wemb ) : # word_set from NL query for table_id , table_contents in tables . items ( ) : # NLq = t1['question'] # word_tokens = NLq.rstrip().replace('?', '').split(' ') headers = table_contents [ 'header_tok' ] # [ ['state/terriotry'], ['current', 'slogan'], [], for header_tokens in headers : for token in header_tokens : idx_w2i , n_total = update_w2i_wemb ( token , wv , idx_w2i , n_total , w2i , wemb ) # WikiSQL generaets unbelivable query... using state/territory in the NLq. Unnatural.. but as is # when there is slash, unlike original SQLNet which treats them as single token, we use # both tokens. e.g. 'state/terriotry' -> 'state' # token_spl = token.split('/') # for token_spl1 in token_spl: #         idx_w2i, n_total = update_w2i_wemb(token_spl1, wv, idx_w2i, n_total, w2i, wemb) return idx_w2i , n_total