Formation of the neural network architecture of the model and downloading its weights to obtain features / scores based on hand-crafted features (text modality)
_b5.text_model_hc_- Нейросетевая модель nn.Module для получения признаков / оценок на базе экспертных признаков
Import required packages
[2]:
from oceanai.modules.lab.build import Run
Build
[3]:
_b5 = Run(
lang = 'en', # Inference language
color_simple = '#333', # Plain text color (hexadecimal code)
color_info = '#1776D2', # The color of the text containing the information (hexadecimal code)
color_err = '#FF0000', # Error text color (hexadecimal code)
color_true = '#008001', # Text color containing positive information (hexadecimal code)
bold_text = True, # Bold text
num_to_df_display = 30, # Number of rows to display in tables
text_runtime = 'Runtime', # Runtime text
metadata = True # Displaying information about library
)
[2024-10-08 19:43:05] OCEANAI - персональные качества личности человека: Авторы: Рюмина Елена [ryumina_ev@mail.ru] Рюмин Дмитрий [dl_03.03.1991@mail.ru] Карпов Алексей [karpov@iias.spb.su] Сопровождающие: Рюмина Елена [ryumina_ev@mail.ru] Рюмин Дмитрий [dl_03.03.1991@mail.ru] Версия: 1.0.0a40 Лицензия: BSD License
Formation of the neural network architecture of the model (FI V2
[4]:
res_load_text_model_hc_fi = _b5.load_text_model_hc(
corpus = "fi", # Corpus selection for models trained on First Impressions V2 'fi' and models trained on for MuPTA 'mupta'
show_summary = False, # Displaying the formed neural network architecture of the model
out = True, # Display
runtime = True, # Runtime count
run = True # Run blockin
)
[2024-10-08 19:43:06] Формирование нейросетевой архитектуры модели для получения оценок по экспертным признакам (текстовая модальность) …
— Время выполнения: 0.002 сек. —
Downloading the weights of the neural network model
[5]:
# Настройки ядра
_b5.path_to_save_ = './models' # Директория для сохранения файла
_b5.chunk_size_ = 2000000 # Размер загрузки файла из сети за 1 шаг
url = _b5.weights_for_big5_['text']['fi']['hc']['googledisk']
res_load_text_model_weights_hc_fi = _b5.load_text_model_weights_hc(
url = url, # Полный путь к файлу с весами нейросетевой модели
force_reload = True, # Принудительная загрузка файла с весами нейросетевой модели из сети
out = True, # Отображение
runtime = True, # Подсчет времени выполнения
run = True # Блокировка выполнения
)
[2024-10-08 19:43:06] Загрузка весов нейросетевой модели для получения оценок по экспертным признакам (текстовая модальность) …
[2024-10-08 19:43:08] Загрузка файла “weights_2023-07-15_10-52-15.pth” 100.0% …
— Время выполнения: 2.395 сек. —
Displaying the formed neural network architecture of the model
[6]:
_b5.text_model_hc_
[6]:
text_model_hc(
(lstm1): LSTM(64, 32, batch_first=True, bidirectional=True)
(attention): Attention()
(lstm2): LSTM(64, 32, batch_first=True, bidirectional=True)
(dense): Linear(in_features=64, out_features=64, bias=True)
(addition): Addition()
(final_dense): Linear(in_features=128, out_features=5, bias=True)
)
Formation of the neural network architecture of the model (MuPTA)
[7]:
res_load_text_model_hc_mupta = _b5.load_text_model_hc(
corpus = "mupta", # Corpus selection for models trained on First Impressions V2 'fi' and models trained on for MuPTA 'mupta'
show_summary = False, # Displaying the formed neural network architecture of the model
out = True, # Display
runtime = True, # Runtime count
run = True # Run blocking
)
[2024-10-08 19:43:08] Формирование нейросетевой архитектуры модели для получения оценок по экспертным признакам (текстовая модальность) …
— Время выполнения: 0.002 сек. —
Downloading the weights of the neural network model
[8]:
# Настройки ядра
_b5.path_to_save_ = './models' # Директория для сохранения файла
_b5.chunk_size_ = 2000000 # Размер загрузки файла из сети за 1 шаг
url = _b5.weights_for_big5_['text']['mupta']['hc']['googledisk']
res_load_text_model_weights_hc_mupta = _b5.load_text_model_weights_hc(
url = url, # Полный путь к файлу с весами нейросетевой модели
force_reload = True, # Принудительная загрузка файла с весами нейросетевой модели из сети
out = True, # Отображение
runtime = True, # Подсчет времени выполнения
run = True # Блокировка выполнения
)
[2024-10-08 19:43:08] Загрузка весов нейросетевой модели для получения оценок по экспертным признакам (текстовая модальность) …
[2024-10-08 19:43:10] Загрузка файла “weights_2023-07-15_10-53-38.pth” 100.0% …
— Время выполнения: 2.417 сек. —
Displaying the formed neural network architecture of the model
[9]:
_b5.text_model_hc_
[9]:
text_model_hc(
(lstm1): LSTM(64, 32, batch_first=True, bidirectional=True)
(attention): Attention()
(lstm2): LSTM(64, 32, batch_first=True, bidirectional=True)
(dense): Linear(in_features=64, out_features=64, bias=True)
(addition): Addition()
(final_dense): Linear(in_features=128, out_features=5, bias=True)
)