(word, wv, idx_w2i, n_total, w2i, wemb)
return idx_w2i, n_total
Follow same approach from SQLNet author's code.
        Used inside of generaet_w2i_wemb.
Follow same approach from SQLNet author's code.
        Used inside of generaet_w2i_wemb.
Follow same approach from SQLNet author s code . Used inside of generaet_w2i_wemb .
def update_w2i_wemb(word, wv, idx_w2i, n_total, w2i, wemb):
    """ Follow same approach from SQLNet author's code.
        Used inside of generaet_w2i_wemb.
    """

    # global idx_w2i, w2i, wemb  # idx, word2vec, word to idx dictionary, list of embedding vec, n_total: total number of words
    if (word in wv) and (word not in w2i):
        idx_w2i += 1
        w2i[word] = idx_w2i
        wemb.append(wv[word])
    n_total += 1
    return idx_w2i, n_total
def update_w2i_wemb ( word , wv , idx_w2i , n_total , w2i , wemb ) : # global idx_w2i, w2i, wemb  # idx, word2vec, word to idx dictionary, list of embedding vec, n_total: total number of words if ( word in wv ) and ( word not in w2i ) : idx_w2i += 1 w2i [ word ] = idx_w2i wemb . append ( wv [ word ] ) n_total += 1 return idx_w2i , n_total