Короче, ничего не получилось что хотел :(
Завтра сделаю фильтрованый датасет по городам, чтобы отдавать также инфу из городов
This commit is contained in:
parent
b4dc220fe5
commit
1f5bd6bdbf
2
model.py
2
model.py
@ -12,7 +12,7 @@ with open('neural_network/models/tokenization/tokenizer_lstm_lstm_negative.pickl
|
|||||||
tokenizer = pickle.load(handle)
|
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()]
|
class_names = [line.strip() for line in file.readlines()]
|
||||||
|
|
||||||
def preprocess_text(text: str):
|
def preprocess_text(text: str):
|
||||||
|
@ -38,7 +38,7 @@ def process_dataset(dataset_path, label_column, output_path):
|
|||||||
dataset = label_processor.encode_labels()
|
dataset = label_processor.encode_labels()
|
||||||
class_names = label_processor.get_class_names()
|
class_names = label_processor.get_class_names()
|
||||||
|
|
||||||
# Save class names
|
# Save classification names
|
||||||
label_processor.save_class_names(class_names, output_path)
|
label_processor.save_class_names(class_names, output_path)
|
||||||
|
|
||||||
return dataset
|
return dataset
|
@ -1,3 +1,5 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
import kaggle
|
import kaggle
|
||||||
import zipfile
|
import zipfile
|
||||||
import os
|
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_positive, 'class/class_positive.txt')
|
||||||
FileSaver.save_rubrics_to_file(unique_rubrics_negative, 'class/class_negative.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_positive, 'filtered/filtered_dataset_positive.csv')
|
||||||
FileSaver.save_dataset_to_csv(filtered_negative, '../dataset/filtered/filtered_dataset_negative.csv')
|
FileSaver.save_dataset_to_csv(filtered_negative, 'filtered/filtered_dataset_negative.csv')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -206,7 +206,7 @@ class Plotter:
|
|||||||
def main():
|
def main():
|
||||||
|
|
||||||
tokenizer_path_positive = '../tokenization/tokenizer_positive.pickle'
|
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'
|
dataset_path_positive = '../dataset/filtered/filtered_dataset_positive.csv'
|
||||||
|
|
||||||
model_save_path_lstm_positive = './model/best_model_lstm_positive.keras'
|
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'
|
plot_save_path_gru_positive = './graphics/history_gru_positive.png'
|
||||||
|
|
||||||
tokenizer_path_negative = '../tokenization/tokenizer_negative.pickle'
|
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'
|
dataset_path_negative = '../dataset/filtered/filtered_dataset_negative.csv'
|
||||||
|
|
||||||
model_save_path_lstm_negative = './model/best_model_lstm_negative.keras'
|
model_save_path_lstm_negative = './model/best_model_lstm_negative.keras'
|
||||||
|
Loading…
Reference in New Issue
Block a user