Formation of the neural network architecture of the model and downloading its weights to obtain personality traits scores (text modality)
_b5.text_model_b5_
- Neural network model tf.keras.Model for obtaining the personality traits scores
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
)
[2023-12-10 17:03:46] OCEANAI - personaly traits: Authors: Elena Ryumina [ryumina_ev@mail.ru] Dmitry Ryumin [dl_03.03.1991@mail.ru] Alexey Karpov [karpov@iias.spb.su] Maintainers: Elena Ryumina [ryumina_ev@mail.ru] Dmitry Ryumin [dl_03.03.1991@mail.ru] Version: 1.0.0a16 License: BSD License
Formation of neural network architectures of models
[4]:
res_load_text_model_b5 = _b5.load_text_model_b5(
show_summary = False, # Displaying the formed neural network architecture of the model
out = True, # Display
runtime = True, # Runtime count
run = True # Run blocking
)
[2023-12-10 17:03:46] Formation of neural network architectures of models for obtaining the personality traits scores (text modality) …
— Runtime: 0.539 sec. —
Downloading weights of neural network models
FI V2
[5]:
# Core settings
_b5.path_to_save_ = './models' # Directory to save the file
_b5.chunk_size_ = 2000000 # File download size from network in 1 step
url = _b5.weights_for_big5_['text']['fi']['b5']['sberdisk']
res_load_text_model_weights_b5 = _b5.load_text_model_weights_b5(
url = url,
force_reload = False, # Forced download of a file with weights of a neural network model from the network
out = True, # Display
runtime = True, # Runtime count
run = True # Run blocking
)
[2023-12-10 17:03:46] Downloading the weights of neural network models to obtain the personality traits scores (text modality) …
[2023-12-14 21:04:19] File download “ft_fi_2023-12-09_14-25-13.h5”
— Runtime: 0.144 sec. —
MuPTA
[6]:
# Core settings
_b5.path_to_save_ = './models' # Directory to save the file
_b5.chunk_size_ = 2000000 # Размер загрузки файла из сети за 1 шаг
url = _b5.weights_for_big5_['text']['mupta']['b5']['sberdisk']
res_load_text_model_weights_b5 = _b5.load_text_model_weights_b5(
url = url,
force_reload = False, # Forced download of a file with weights of a neural network model from the network
out = True, # Display
runtime = True, # Runtime count
run = True # Run blocking
)
[2023-12-10 17:03:47] Downloading the weights of neural network models to obtain the personality traits scores (text modality) …
[2023-12-10 17:03:47] File download “ft_mupta_2023-12-09_14-25-13.h5”
— Runtime: 0.137 sec. —
Displaying the formed neural network architecture of the model
[7]:
_b5.text_model_b5_.summary()
Model: "model"
__________________________________________________________________________________________________
Layer (type) Output Shape Param # Connected to
==================================================================================================
input_1 (InputLayer) [(None, 5)] 0 []
input_2 (InputLayer) [(None, 5)] 0 []
tf.concat (TFOpLambda) (None, 10) 0 ['input_1[0][0]',
'input_2[0][0]']
dense (Dense) (None, 5) 55 ['tf.concat[0][0]']
==================================================================================================
Total params: 55
Trainable params: 55
Non-trainable params: 0
__________________________________________________________________________________________________