(example, table)
return ann
Jan. 2019: Wonseok
    Annotate only the information that will be used in our model.
Jan. 2019: Wonseok
    Annotate only the information that will be used in our model.
Jan . 2019 : Wonseok Annotate only the information that will be used in our model .
def annotate_example_ws(example, table):
    """
    Jan. 2019: Wonseok
    Annotate only the information that will be used in our model.
    """
    ann = {'table_id': example['table_id'],'phase': example['phase']}
    _nlu_ann = annotate(example['question'])
    ann['question'] = example['question']
    ann['question_tok'] = _nlu_ann['gloss']
    # ann['table'] = {
    #     'header': [annotate(h) for h in table['header']],
    # }
    ann['sql'] = example['sql']
    ann['query'] = sql = copy.deepcopy(example['sql'])

    conds1 = ann['sql']['conds']
    wv_ann1 = []
    for conds11 in conds1:
        _wv_ann1 = annotate(str(conds11[2]))
        wv_ann11 = _wv_ann1['gloss']
        wv_ann1.append( wv_ann11 )

        # Check whether wv_ann exsits inside question_tok

    try:
        wvi1_corenlp = check_wv_tok_in_nlu_tok(wv_ann1, ann['question_tok'])
        ann['wvi_corenlp'] = wvi1_corenlp
    except:
        ann['wvi_corenlp'] = None
        ann['tok_error'] = 'SQuAD style st, ed are not found under CoreNLP.'

    return ann
def annotate_example_ws ( example , table ) : ann = { 'table_id' : example [ 'table_id' ] , 'phase' : example [ 'phase' ] } _nlu_ann = annotate ( example [ 'question' ] ) ann [ 'question' ] = example [ 'question' ] ann [ 'question_tok' ] = _nlu_ann [ 'gloss' ] # ann['table'] = { #     'header': [annotate(h) for h in table['header']], # } ann [ 'sql' ] = example [ 'sql' ] ann [ 'query' ] = sql = copy . deepcopy ( example [ 'sql' ] ) conds1 = ann [ 'sql' ] [ 'conds' ] wv_ann1 = [ ] for conds11 in conds1 : _wv_ann1 = annotate ( str ( conds11 [ 2 ] ) ) wv_ann11 = _wv_ann1 [ 'gloss' ] wv_ann1 . append ( wv_ann11 ) # Check whether wv_ann exsits inside question_tok try : wvi1_corenlp = check_wv_tok_in_nlu_tok ( wv_ann1 , ann [ 'question_tok' ] ) ann [ 'wvi_corenlp' ] = wvi1_corenlp except : ann [ 'wvi_corenlp' ] = None ann [ 'tok_error' ] = 'SQuAD style st, ed are not found under CoreNLP.' return ann