Есть код,коотрый использует keras для многоклассовой классификации  import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences

max_len = 600  # максимальная длина последовательности

# создаем токенизатор
tokenizer = Tokenizer()
tokenizer.fit_on_texts(train_df['lemma'])

# преобразуем текст в последовательность чисел
train_sequences = tokenizer.texts_to_sequences(train_df['lemma'])
test_sequences = tokenizer.texts_to_sequences(test_df['lemma'])
val_sequences = tokenizer.texts_to_sequences(val_df['lemma'])

# добавляем паддинг
train_sequences = pad_sequences(train_sequences, maxlen=max_len)
test_sequences = pad_sequences(test_sequences, maxlen=max_len)
val_sequences = pad_sequences(val_sequences, maxlen=max_len)

# создаем модель seq2seq
input_dim = len(tokenizer.word_index) + 1
embedding_dim = 50

model = keras.Sequential([
    layers.Embedding(input_dim=input_dim, output_dim=embedding_dim, input_length=max_len),
    layers.LSTM(units=64, dropout=0.2, recurrent_dropout=0.2),
    layers.Dense(1, activation='sigmoid')
])

model.summary()  # выводим информацию о модели from sklearn.metrics import f1_score
import tensorflow.keras.backend as K
from tensorflow.keras.losses import CategoricalCrossentropy


import numpy as np

from keras import backend as K

def recall_m(y_true, y_pred):
    true_positives = K.sum(K.round(K.clip(y_true * y_pred, 0, 1)))
    possible_positives = K.sum(K.round(K.clip(y_true, 0, 1)))
    recall = true_positives / (possible_positives + K.epsilon())
    return recall

def precision_m(y_true, y_pred):
    true_positives = K.sum(K.round(K.clip(y_true * y_pred, 0, 1)))
    predicted_positives = K.sum(K.round(K.clip(y_pred, 0, 1)))
    precision = true_positives / (predicted_positives + K.epsilon())
    return precision

def f1_m(y_true, y_pred):
    precision = precision_m(y_true, y_pred)
    recall = recall_m(y_true, y_pred)
    return 2*((precision*recall)/(precision+recall+K.epsilon()))


model.compile(loss=CategoricalCrossentropy(), optimizer='adam', metrics=['acc',f1_m,precision_m, recall_m])

history = model.fit(train_sequences, train_df['category'], 
                    epochs=10, batch_size=1000, 
                    validation_data=(val_sequences, val_df['category'])). ОН дает результаты Epoch 1/10
31/31 [==============================] - 326s 10s/step - loss: 0.0000e+00 - acc: 0.0784 - f1_m: 1.0000 - precision_m: 1.0000 - recall_m: 1.0000 - val_loss: 0.0000e+00 - val_acc: 0.0723 - val_f1_m: 1.0000 - val_precision_m: 1.0000 - val_recall_m: 1.0000
Epoch 2/10
31/31 [==============================] - 320s 10s/step - loss: 0.0000e+00 - acc: 0.0784 - f1_m: 1.0000 - precision_m: 1.0000 - recall_m: 1.0000 - val_loss: 0.0000e+00 - val_acc: 0.0723 - val_f1_m: 1.0000 - val_precision_m: 1.0000 - val_recall_m: 1.0000
Epoch 3/10
31/31 [==============================] - 316s 10s/step - loss: 0.0000e+00 - acc: 0.0784 - f1_m: 1.0000 - precision_m: 1.0000 - recall_m: 1.0000 - val_loss: 0.0000e+00 - val_acc: 0.0723 - val_f1_m: 1.0000 - val_precision_m: 1.0000 - val_recall_m: 1.0000
Epoch 4/10
31/31 [==============================] - 315s 10s/step - loss: 0.0000e+00 - acc: 0.0784 - f1_m: 1.0000 - precision_m: 1.0000 - recall_m: 1.0000 - val_loss: 0.0000e+00 - val_acc: 0.0723 - val_f1_m: 1.0000 - val_precision_m: 1.0000 - val_recall_m: 1.0000
Epoch 5/10
31/31 [==============================] - 316s 10s/step - loss: 0.0000e+00 - acc: 0.0784 - f1_m: 1.0000 - precision_m: 1.0000 - recall_m: 1.0000 - val_loss: 0.0000e+00 - val_acc: 0.0723 - val_f1_m: 1.0000 - val_precision_m: 1.0000 - val_recall_m: 1.0000
Вопрос: верно ли составлена модель и правильные ли она рехультаты выдает при обучении?