def test_qa_with_dic(): happy_qa = HappyQuestionAnswering() train_args = {'learning_rate': 0.01, "num_train_epochs": 1} happy_qa.train("../data/qa/train-eval.csv", args=train_args) eval_args = {} result_eval = happy_qa.eval("../data/qa/train-eval.csv", args=eval_args) assert type(result_eval.loss) == float test_args = {} result_test = happy_qa.test("../data/qa/test.csv", args=test_args) assert type(result_test[0].answer) == str
def test_tc_with_dataclass(): happy_qa = HappyQuestionAnswering() train_args = QATrainArgs(learning_rate=0.01, num_train_epochs=1) happy_qa.train("../data/qa/train-eval.csv", args=train_args) eval_args = QAEvalArgs() result_eval = happy_qa.eval("../data/qa/train-eval.csv", args=eval_args) assert type(result_eval.loss) == float test_args = QATestArgs() result_test = happy_qa.test("../data/qa/test.csv", args=test_args) assert type(result_test[0].answer) == str
def test_qa_test(): happy_qa = HappyQuestionAnswering() results = happy_qa.test("../data/qa/test.csv") assert results[0].answer == 'October 31st' assert results[1].answer == 'November 23rd'