diff --git a/Models/webaskb_ptrnet.py b/Models/webaskb_ptrnet.py index 5e179cb..4a5012e 100644 --- a/Models/webaskb_ptrnet.py +++ b/Models/webaskb_ptrnet.py @@ -225,7 +225,7 @@ def forward(self,input_variable, target_variable, loss=0, DO_TECHER_FORCING=Fals result.append(np.argmax(decoder_attention.data[0].tolist())) if type(loss)!=int: - loss_value = loss.data[0] / target_length + loss_value = loss.item() / target_length else: loss_value = 0 - return loss_value , result, loss \ No newline at end of file + return loss_value , result, loss diff --git a/README.md b/README.md index f1746d0..ffd6bce 100755 --- a/README.md +++ b/README.md @@ -72,11 +72,11 @@ can be downloaded from [ComplexWebQuestions](http://nlp.cs.tau.ac.il/compwebq) Now you can do any of the following: -* Generate the noisy supervision data for training `python -m webaskb_run.py gen_noisy_sup`. -* Run a pointer network to generate split points in the question `python -m webaskb_run.py run_ptrnet`. -* Train the pointer network `python -m webaskb_run.py train_ptrnet`. -* Create final predication and calculate p@1 scores `python -m webaskb_run.py splitqa`. -* NEW! Run evaluation script for dev set `python -m eval_script.py Data/complex_web_questions/ComplexWebQuestions_dev.json Data/predictions_dev.json`. +* Generate the noisy supervision data for training `python -m webaskb_run gen_noisy_sup`. +* Run a pointer network to generate split points in the question `python -m webaskb_run run_ptrnet`. +* Train the pointer network `python -m webaskb_run train_ptrnet`. +* Create final predication and calculate p@1 scores `python -m webaskb_run splitqa`. +* NEW! Run evaluation script for dev set `python -m eval_script Data/complex_web_questions/ComplexWebQuestions_dev.json Data/predictions_dev.json`. Options: ‘—eval_set dev’ or ‘—eval_set test’ to choose between the development and test set.