raosudha89 / ranking_clarification_questions

Code and Data for the paper: "Learning to Ask Good Questions: Ranking Clarification Questions using Neural Expected Value of Perfect Information"
102 stars 25 forks source link

unresolved reference get_indices() in src/models/load_data.py #1

Closed lidra closed 6 years ago

lidra commented 6 years ago

Hi, raosudha89, I am very glad that you share you code. Your paper is interesting and I am trying to run your code. But something is wrong when I run 'run_load_data.sh'.

In the function 'generate_neural_vectors', get_indices() is unresolved reference.

def generate_neural_vectors(posts, titles, ques_lists, ans_lists, post_ids, vocab, N, split): post_vectors = [] ques_list_vectors = [] ans_list_vectors = [] for post_id in post_ids: post_vectors.append(get_indices(titles[post_id] + ' ' + posts[post_id], vocab)) ques_list_vector = [None] N ans_list_vector = [None] N for k in range(N): ques_list_vector[k] = get_indices(ques_lists[post_id][k], vocab) ans_list_vector[k] = get_indices(ans_lists[post_id][k], vocab) ques_list_vectors.append(ques_list_vector) ans_list_vectors.append(ans_list_vector) dirname = os.path.dirname(args.train_ids) p.dump(post_ids, open(os.path.join(dirname, 'postids' + split + '.p'), 'wb')) p.dump(post_vectors, open(os.path.join(dirname, 'postvectors' + split + '.p'), 'wb')) p.dump(ques_list_vectors, open(os.path.join(dirname, 'ques_listvectors' + split + '.p'), 'wb')) p.dump(ans_list_vectors, open(os.path.join(dirname, 'ans_listvectors' + split + '.p'), 'wb'))

raosudha89 commented 6 years ago

Hi lidra,

Thank you for pointing out the issue. I have added the missing function into the file. It should now find the function. Let me know if you face any further issues.

Thanks Sudha

lidra commented 6 years ago

thanks very much. Do you have a version of tensorflow ?

raosudha89 commented 6 years ago

No, I have the code written only in lasagne at this point.