Repository: knodle/knodle (language: python)

Issue:
models organisation
models: would rather have them without extra sub folds, but directly in model folder: model/logistic_regression/logisitc_regression_with_emb_layer.py, model/logistic_regression/logistic_regression_model.py, model/logistic_regression/bidirectional_lstm_model.py


Discussion / hints:

Fix patch:
diff --git a/knodle/model/logistic_regression/logisitc_regression_with_emb_layer.py b/knodle/model/logisitc_regression_with_emb_layer.py
similarity index 100%
rename from knodle/model/logistic_regression/logisitc_regression_with_emb_layer.py
rename to knodle/model/logisitc_regression_with_emb_layer.py
diff --git a/knodle/model/logistic_regression/__init__.py b/knodle/model/logistic_regression/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/knodle/model/logistic_regression/logistic_regression_model.py b/knodle/model/logistic_regression_model.py
similarity index 100%
rename from knodle/model/logistic_regression/logistic_regression_model.py
rename to knodle/model/logistic_regression_model.py
diff --git a/tutorials/__init__.py b/tutorials/__init__.py
index 5ed96d8e..088191c5 100644
--- a/tutorials/__init__.py
+++ b/tutorials/__init__.py
@@ -6,9 +6,6 @@
 __all__ = []
 
 import logging
-from knodle.model.logistic_regression.logistic_regression_model import (
-    LogisticRegressionModel,
-)
 
 logger = logging.getLogger()
 handler = logging.StreamHandler()
diff --git a/tutorials/baseline/baseline_training_example.py b/tutorials/baseline/baseline_training_example.py
index 84e466af..f7c4a9e2 100644
--- a/tutorials/baseline/baseline_training_example.py
+++ b/tutorials/baseline/baseline_training_example.py
@@ -6,7 +6,7 @@
 from torch.utils.data import TensorDataset
 
 from knodle.data.download import MinioConnector
-from knodle.model.logistic_regression.logistic_regression_model import (
+from knodle.model.logistic_regression_model import (
     LogisticRegressionModel,
 )
 from knodle.trainer.baseline.baseline import NoDenoisingTrainer
diff --git a/tutorials/knn_conll/train_conll_knn.py b/tutorials/knn_conll/train_conll_knn.py
index 3cc8d552..d7122b70 100644
--- a/tutorials/knn_conll/train_conll_knn.py
+++ b/tutorials/knn_conll/train_conll_knn.py
@@ -4,7 +4,7 @@
 from sklearn.feature_extraction.text import TfidfVectorizer
 from torch.optim import AdamW
 
-from knodle.model.logistic_regression.logistic_regression_model import (
+from knodle.model.logistic_regression_model import (
     LogisticRegressionModel,
 )
 from knodle.trainer import TrainerConfig
diff --git a/tutorials/knn_tfidf_similarity_example/knn_sim_tutorial.py b/tutorials/knn_tfidf_similarity_example/knn_sim_tutorial.py
index a26dd040..876d1f99 100644
--- a/tutorials/knn_tfidf_similarity_example/knn_sim_tutorial.py
+++ b/tutorials/knn_tfidf_similarity_example/knn_sim_tutorial.py
@@ -1,6 +1,5 @@
 import logging
 import os
-import sys
 
 from torch import Tensor
 from torch.optim import AdamW
@@ -8,7 +7,7 @@
 from torch.utils.tensorboard import SummaryWriter
 
 from knodle.data.download import MinioConnector
-from knodle.model.logistic_regression.logistic_regression_model import (
+from knodle.model.logistic_regression_model import (
     LogisticRegressionModel,
 )
 from knodle.trainer.knn_denoising.config import KNNConfig


Test patch:
diff --git a/tests/trainer/baseline/test_baseline.py b/tests/trainer/baseline/test_baseline.py
index 79e5570e..f75c31bb 100644
--- a/tests/trainer/baseline/test_baseline.py
+++ b/tests/trainer/baseline/test_baseline.py
@@ -2,7 +2,7 @@
 import torch
 from torch.utils.data import TensorDataset
 
-from knodle.model.logistic_regression.logistic_regression_model import LogisticRegressionModel
+from knodle.model.logistic_regression_model import LogisticRegressionModel
 from knodle.trainer.baseline.no_denoising import NoDenoisingTrainer
 
 
diff --git a/tests/trainer/crossweigh/test_cw_labels_calculation.py b/tests/trainer/crossweigh/test_cw_labels_calculation.py
index 150201f8..bd4dd89f 100644
--- a/tests/trainer/crossweigh/test_cw_labels_calculation.py
+++ b/tests/trainer/crossweigh/test_cw_labels_calculation.py
@@ -4,7 +4,7 @@
 from torch import LongTensor
 from torch.utils.data import TensorDataset
 
-from knodle.model.logistic_regression.logistic_regression_model import LogisticRegressionModel
+from knodle.model.logistic_regression_model import LogisticRegressionModel
 from knodle.trainer.crossweigh_weighing.crossweigh_weights_calculator import CrossWeighWeightsCalculator