(vocabulary_word2index,vocabulary_word2index_label,questionid_question_lists,uni_to_tri_gram=False)
| 414 | return question_lists_result |
| 415 | |
| 416 | def load_data_predict(vocabulary_word2index,vocabulary_word2index_label,questionid_question_lists,uni_to_tri_gram=False): # n_words=100000, |
| 417 | final_list=[] |
| 418 | for i, tuplee in enumerate(questionid_question_lists): |
| 419 | queston_id,question_string_list=tuplee |
| 420 | if uni_to_tri_gram: |
| 421 | x_=process_one_sentence_to_get_ui_bi_tri_gram(question_string_list) |
| 422 | x=x_.split(" ") |
| 423 | else: |
| 424 | x=question_string_list.split(" ") |
| 425 | x = [vocabulary_word2index.get(e, 0) for e in x] #if can't find the word, set the index as '0'.(equal to PAD_ID = 0) |
| 426 | if i<=2: |
| 427 | print("question_id:",queston_id);print("question_string_list:",question_string_list);print("x_indexed:",x) |
| 428 | final_list.append((queston_id,x)) |
| 429 | number_examples = len(final_list) |
| 430 | print("number_examples:",number_examples) # |
| 431 | return final_list |
| 432 | |
| 433 | |
| 434 | def proces_label_to_algin(ys_list,require_size=5): |
no test coverage detected