diff --git a/model.py b/model.py index 551c00b..09695a0 100644 --- a/model.py +++ b/model.py @@ -12,7 +12,7 @@ with open('neural_network/models/tokenization/tokenizer_lstm_lstm_negative.pickl tokenizer = pickle.load(handle) # Загрузка названий классов -with open('neural_network/models/class/class_names_lstm_negative.txt', 'r', encoding='utf-8') as file: +with open('neural_network/models/classification/class_names_lstm_negative.txt', 'r', encoding='utf-8') as file: class_names = [line.strip() for line in file.readlines()] def preprocess_text(text: str): diff --git a/neural_network/class/class_save.py b/neural_network/classification/class_save.py similarity index 98% rename from neural_network/class/class_save.py rename to neural_network/classification/class_save.py index 7888583..e8f287a 100644 --- a/neural_network/class/class_save.py +++ b/neural_network/classification/class_save.py @@ -38,7 +38,7 @@ def process_dataset(dataset_path, label_column, output_path): dataset = label_processor.encode_labels() class_names = label_processor.get_class_names() - # Save class names + # Save classification names label_processor.save_class_names(class_names, output_path) return dataset diff --git a/neural_network/dataset/conversion.py b/neural_network/dataset/conversion.py index fd03d57..d3af52a 100644 --- a/neural_network/dataset/conversion.py +++ b/neural_network/dataset/conversion.py @@ -1,3 +1,5 @@ +import sys + import kaggle import zipfile import os @@ -116,8 +118,8 @@ def main(): # Сохранение результатов FileSaver.save_rubrics_to_file(unique_rubrics_positive, 'class/class_positive.txt') FileSaver.save_rubrics_to_file(unique_rubrics_negative, 'class/class_negative.txt') - FileSaver.save_dataset_to_csv(filtered_positive, '../dataset/filtered/filtered_dataset_positive.csv') - FileSaver.save_dataset_to_csv(filtered_negative, '../dataset/filtered/filtered_dataset_negative.csv') + FileSaver.save_dataset_to_csv(filtered_positive, 'filtered/filtered_dataset_positive.csv') + FileSaver.save_dataset_to_csv(filtered_negative, 'filtered/filtered_dataset_negative.csv') if __name__ == "__main__": diff --git a/neural_network/models/create_model.py b/neural_network/models/create_model.py index d075619..27ef43a 100644 --- a/neural_network/models/create_model.py +++ b/neural_network/models/create_model.py @@ -206,7 +206,7 @@ class Plotter: def main(): tokenizer_path_positive = '../tokenization/tokenizer_positive.pickle' - class_names_path_positive = '../class/class_names_positive.txt' + class_names_path_positive = '../classification/class_names_positive.txt' dataset_path_positive = '../dataset/filtered/filtered_dataset_positive.csv' model_save_path_lstm_positive = './model/best_model_lstm_positive.keras' @@ -219,7 +219,7 @@ def main(): plot_save_path_gru_positive = './graphics/history_gru_positive.png' tokenizer_path_negative = '../tokenization/tokenizer_negative.pickle' - class_names_path_negative = '../class/class_names_negative.txt' + class_names_path_negative = '../classification/class_names_negative.txt' dataset_path_negative = '../dataset/filtered/filtered_dataset_negative.csv' model_save_path_lstm_negative = './model/best_model_lstm_negative.keras'