def evaluate(model, dictionary, session_queries): sess = Session() sess.queries = session_queries session_tensor, query_lengths = helper.session_to_tensor([sess], dictionary, True) if args.cuda: session_tensor = session_tensor.cuda() query_lengths = query_lengths.cuda() return suggest_next_query(model, dictionary, session_tensor, query_lengths)
def evaluate(model, dictionary, session_queries): session = Session() session.queries = session_queries session_queries, session_query_length, rel_docs, rel_docs_length, doc_labels = helper.session_to_tensor( [session], dictionary, iseval=True) if model.config.cuda: session_queries = session_queries.cuda() session_query_length = session_query_length.cuda() return suggest_next_query(model, session_queries, session_query_length, dictionary)