(nlu, nlu_t, wh_to_wp_index, sql_i, sql_t, tokenizer, nlu_wp_t)
return g_wvi
Generate SQuAD style start and end index of wv in nlu. Index is for of after WordPiece tokenization.

    Assumption: where_str always presents in the nlu.
Generate SQuAD style start and end index of wv in nlu. Index is for of after WordPiece tokenization.
Generate SQuAD style start and end index of wv in nlu . Index is for of after WordPiece tokenization .
def get_g_wvi_bert_from_sql_i(nlu, nlu_t, wh_to_wp_index, sql_i, sql_t, tokenizer, nlu_wp_t):
    """
    Generate SQuAD style start and end index of wv in nlu. Index is for of after WordPiece tokenization.

    Assumption: where_str always presents in the nlu.
    """
    g_wvi = []
    for b, sql_i1 in enumerate(sql_i):
        nlu1 = nlu[b]
        nlu_t1 = nlu_t[b]
        nlu_wp_t1 = nlu_wp_t[b]
        sql_t1 = sql_t[b]
        wh_to_wp_index1 = wh_to_wp_index[b]

        st = sql_t1.index('WHERE') + 1 if 'WHERE' in sql_t1 else len(sql_t1)
        g_wvi1 = []
        while st < len(sql_t1):
            if 'AND' not in sql_t1[st:]:
                ed = len(sql_t1)
            else:
                ed = sql_t1[st:].index('AND') + st
            sql_wop = find_sql_where_op(sql_t1[st:ed])  # sql where operator
            st_wop = st + sql_t1[st:ed].index(sql_wop)

            wv_str11_t = sql_t1[st_wop + 1:ed]
            results = find_sub_list(wv_str11_t, nlu_t1)
            st_idx, ed_idx = results[0]

            st_wp_idx = wh_to_wp_index1[st_idx]
            ed_wp_idx = wh_to_wp_index1[ed_idx]


            g_wvi11 = [st_wp_idx, ed_wp_idx]
            g_wvi1.append(g_wvi11)
            st = ed + 1
        g_wvi.append(g_wvi1)

    return g_wvi
def get_g_wvi_bert_from_sql_i ( nlu , nlu_t , wh_to_wp_index , sql_i , sql_t , tokenizer , nlu_wp_t ) : g_wvi = [ ] for b , sql_i1 in enumerate ( sql_i ) : nlu1 = nlu [ b ] nlu_t1 = nlu_t [ b ] nlu_wp_t1 = nlu_wp_t [ b ] sql_t1 = sql_t [ b ] wh_to_wp_index1 = wh_to_wp_index [ b ] st = sql_t1 . index ( 'WHERE' ) + 1 if 'WHERE' in sql_t1 else len ( sql_t1 ) g_wvi1 = [ ] while st < len ( sql_t1 ) : if 'AND' not in sql_t1 [ st : ] : ed = len ( sql_t1 ) else : ed = sql_t1 [ st : ] . index ( 'AND' ) + st sql_wop = find_sql_where_op ( sql_t1 [ st : ed ] ) # sql where operator st_wop = st + sql_t1 [ st : ed ] . index ( sql_wop ) wv_str11_t = sql_t1 [ st_wop + 1 : ed ] results = find_sub_list ( wv_str11_t , nlu_t1 ) st_idx , ed_idx = results [ 0 ] st_wp_idx = wh_to_wp_index1 [ st_idx ] ed_wp_idx = wh_to_wp_index1 [ ed_idx ] g_wvi11 = [ st_wp_idx , ed_wp_idx ] g_wvi1 . append ( g_wvi11 ) st = ed + 1 g_wvi . append ( g_wvi1 ) return g_wvi