From 57f37c82d0548d06f878227d14b90a98f2eccdf1 Mon Sep 17 00:00:00 2001 From: nreimers Date: Fri, 20 Apr 2018 14:50:01 +0200 Subject: [PATCH] Store results --- Train_Chunking.py | 1 + Train_POS.py | 3 ++- docs/Training.md | 14 +++++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Train_Chunking.py b/Train_Chunking.py index ca52e8a..95e2599 100644 --- a/Train_Chunking.py +++ b/Train_Chunking.py @@ -64,6 +64,7 @@ model = BiLSTM(params) model.setMappings(mappings, embeddings) model.setDataset(datasets, data) +model.storeResults('results/conll2000_chunking.csv') #Path to store performance scores for dev / test model.modelSavePath = "models/[ModelName]_[DevScore]_[TestScore]_[Epoch].h5" model.fit(epochs=25) diff --git a/Train_POS.py b/Train_POS.py index 4392da3..05eb8d2 100644 --- a/Train_POS.py +++ b/Train_POS.py @@ -64,7 +64,8 @@ model = BiLSTM(params) model.setMappings(mappings, embeddings) model.setDataset(datasets, data) -model.modelSavePath = "models/[ModelName]_[DevScore]_[TestScore]_[Epoch].h5" +model.storeResults('results/unidep_pos_results.csv') #Path to store performance scores for dev / test +model.modelSavePath = "models/[ModelName]_[DevScore]_[TestScore]_[Epoch].h5" #Path to store models model.fit(epochs=25) diff --git a/docs/Training.md b/docs/Training.md index b7a11c1..ee8cb8e 100644 --- a/docs/Training.md +++ b/docs/Training.md @@ -44,7 +44,8 @@ params = {'classifier': ['CRF'], 'LSTM-Size': [100], 'dropout': (0.25, 0.25)} model = BiLSTM(params) model.setMappings(mappings, embeddings) model.setDataset(datasets, data) -model.modelSavePath = "models/[ModelName]_[DevScore]_[TestScore]_[Epoch].h5" +model.storeResults('results/unidep_pos_results.csv') #Path to store performance scores for dev / test +model.modelSavePath = "models/[ModelName]_[DevScore]_[TestScore]_[Epoch].h5" #Path to store models model.fit(epochs=25) ``` @@ -52,6 +53,17 @@ model.fit(epochs=25) `model.modelSavePath` defines the path where the trained models should be stored. `[ModelName]` is replaced by the name of your dataset, `[DevScore]` with the score on the development set, `[TestScore]` with the score on the test set and `[Epoch]` is replaced by the epoch. +## Storing performance Scores +By calling the `model.storeResults()` we specify the path where the performance scores during training should be stored. The file contains for each training epoch a line that contains the following information: +- epoch +- dataset name +- Performance on development set +- Performance on test set +- Highest development set performance so far +- Test performance for epoch with highest development score + + + ## Training BIO-Encoded Labels If you want to perform chunking instead of POS-tagging, simple change the `datasets` variable (`Train_Chunking.py`): ```