(g_wn, g_wc, g_wvi, pr_wvi, mode)
return cnt_list
usalbe only when g_wc was used to find pr_wv
usalbe only when g_wc was used to find pr_wv
usalbe only when g_wc was used to find pr_wv
def get_cnt_wvi_list(g_wn, g_wc, g_wvi, pr_wvi, mode):
    """ usalbe only when g_wc was used to find pr_wv
    """
    cnt_list =[]
    for b, g_wvi1 in enumerate(g_wvi):
        g_wc1 = g_wc[b]
        pr_wvi1 = pr_wvi[b]
        pr_wn1 = len(pr_wvi1)
        g_wn1 = g_wn[b]

        # Now sorting.
        # Sort based wc sequence.
        if mode == 'test':
            idx1 = argsort(array(g_wc1))
        elif mode == 'train':
            idx1 = list( range( g_wn1) )
        else:
            raise ValueError

        if g_wn1 != pr_wn1:
            cnt_list.append(0)
            continue
        else:
            flag = True
            for i_wn, idx11 in enumerate(idx1):
                g_wvi11 = g_wvi1[idx11]
                pr_wvi11 = pr_wvi1[i_wn]
                if g_wvi11 != pr_wvi11:
                    flag = False
                    # print(g_wv1, g_wv11)
                    # print(pr_wv1, pr_wv11)
                    # input('')
                    break
            if flag:
                cnt_list.append(1)
            else:
                cnt_list.append(0)

    return cnt_list
def get_cnt_wvi_list ( g_wn , g_wc , g_wvi , pr_wvi , mode ) : cnt_list = [ ] for b , g_wvi1 in enumerate ( g_wvi ) : g_wc1 = g_wc [ b ] pr_wvi1 = pr_wvi [ b ] pr_wn1 = len ( pr_wvi1 ) g_wn1 = g_wn [ b ] # Now sorting. # Sort based wc sequence. if mode == 'test' : idx1 = argsort ( array ( g_wc1 ) ) elif mode == 'train' : idx1 = list ( range ( g_wn1 ) ) else : raise ValueError if g_wn1 != pr_wn1 : cnt_list . append ( 0 ) continue else : flag = True for i_wn , idx11 in enumerate ( idx1 ) : g_wvi11 = g_wvi1 [ idx11 ] pr_wvi11 = pr_wvi1 [ i_wn ] if g_wvi11 != pr_wvi11 : flag = False # print(g_wv1, g_wv11) # print(pr_wv1, pr_wv11) # input('') break if flag : cnt_list . append ( 1 ) else : cnt_list . append ( 0 ) return cnt_list