Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update unit_tests_fi_en.py #45

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 39 additions & 38 deletions test/unit_tests_fi_en.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
_b5.ext_ = [".mp4"]
_b5.path_to_logs_ = "./logs"

URL_ACCURACY = _b5.true_traits_[corpus]["sberdisk"]
DISK = 'googledisk'
URL_ACCURACY = _b5.true_traits_[corpus][DISK]

_b5.download_file_from_url(
url="https://download.sberdisk.ru/download/file/425715491?token=EyJnTnsfmJIlsbO&filename=" + FILENAME_1, out=False
Expand All @@ -56,7 +57,7 @@ def test_get_visual_features():
_b5.path_to_save_ = PATH_SAVE_MODELS

_b5.load_video_model_deep_fe(out=False)
url = _b5.weights_for_big5_["video"][corpus]["fe"]["sberdisk"]
url = _b5.weights_for_big5_["video"][corpus]["fe"][DISK]
_b5.load_video_model_weights_deep_fe(url=url, out=False)

hc_features, nn_features = _b5.get_visual_features(
Expand Down Expand Up @@ -87,19 +88,19 @@ def test_get_audio_union_predictions():
_b5.path_to_save_ = PATH_SAVE_MODELS

_b5.load_audio_model_hc(out=False)
url = _b5.weights_for_big5_["audio"][corpus]["hc"]["sberdisk"]
url = _b5.weights_for_big5_["audio"][corpus]["hc"][DISK]
_b5.load_audio_model_weights_hc(url=url, out=False)

_b5.load_audio_model_nn(out=False)
url = _b5.weights_for_big5_["audio"][corpus]["nn"]["sberdisk"]
url = _b5.weights_for_big5_["audio"][corpus]["nn"][DISK]
_b5.load_audio_model_weights_nn(url=url, out=False)

_b5.load_audio_models_b5(out=False)
url_openness = _b5.weights_for_big5_["audio"][corpus]["b5"]["openness"]["sberdisk"]
url_conscientiousness = _b5.weights_for_big5_["audio"][corpus]["b5"]["conscientiousness"]["sberdisk"]
url_extraversion = _b5.weights_for_big5_["audio"][corpus]["b5"]["extraversion"]["sberdisk"]
url_agreeableness = _b5.weights_for_big5_["audio"][corpus]["b5"]["agreeableness"]["sberdisk"]
url_non_neuroticism = _b5.weights_for_big5_["audio"][corpus]["b5"]["non_neuroticism"]["sberdisk"]
url_openness = _b5.weights_for_big5_["audio"][corpus]["b5"]["openness"][DISK]
url_conscientiousness = _b5.weights_for_big5_["audio"][corpus]["b5"]["conscientiousness"][DISK]
url_extraversion = _b5.weights_for_big5_["audio"][corpus]["b5"]["extraversion"][DISK]
url_agreeableness = _b5.weights_for_big5_["audio"][corpus]["b5"]["agreeableness"][DISK]
url_non_neuroticism = _b5.weights_for_big5_["audio"][corpus]["b5"]["non_neuroticism"][DISK]
_b5.load_audio_models_weights_b5(
url_openness=url_openness,
url_conscientiousness=url_conscientiousness,
Expand All @@ -119,23 +120,23 @@ def test_get_video_union_predictions():
_b5.path_to_save_ = PATH_SAVE_MODELS

_b5.load_video_model_hc(lang=lang, out=False)
url = _b5.weights_for_big5_["video"][corpus]["hc"]["sberdisk"]
url = _b5.weights_for_big5_["video"][corpus]["hc"][DISK]
_b5.load_video_model_weights_hc(url=url, out=False)

_b5.load_video_model_deep_fe(out=False)
url = _b5.weights_for_big5_["video"][corpus]["fe"]["sberdisk"]
url = _b5.weights_for_big5_["video"][corpus]["fe"][DISK]
_b5.load_video_model_weights_deep_fe(url=url, out=False)

_b5.load_video_model_nn(out=False)
url = _b5.weights_for_big5_["video"][corpus]["nn"]["sberdisk"]
url = _b5.weights_for_big5_["video"][corpus]["nn"][DISK]
_b5.load_video_model_weights_nn(url=url, out=False)

_b5.load_video_models_b5(out=False)
url_openness = _b5.weights_for_big5_["video"][corpus]["b5"]["openness"]["sberdisk"]
url_conscientiousness = _b5.weights_for_big5_["video"][corpus]["b5"]["conscientiousness"]["sberdisk"]
url_extraversion = _b5.weights_for_big5_["video"][corpus]["b5"]["extraversion"]["sberdisk"]
url_agreeableness = _b5.weights_for_big5_["video"][corpus]["b5"]["agreeableness"]["sberdisk"]
url_non_neuroticism = _b5.weights_for_big5_["video"][corpus]["b5"]["non_neuroticism"]["sberdisk"]
url_openness = _b5.weights_for_big5_["video"][corpus]["b5"]["openness"][DISK]
url_conscientiousness = _b5.weights_for_big5_["video"][corpus]["b5"]["conscientiousness"][DISK]
url_extraversion = _b5.weights_for_big5_["video"][corpus]["b5"]["extraversion"][DISK]
url_agreeableness = _b5.weights_for_big5_["video"][corpus]["b5"]["agreeableness"][DISK]
url_non_neuroticism = _b5.weights_for_big5_["video"][corpus]["b5"]["non_neuroticism"][DISK]
_b5.load_video_models_weights_b5(
url_openness=url_openness,
url_conscientiousness=url_conscientiousness,
Expand All @@ -157,15 +158,15 @@ def test_get_text_union_predictions():
_b5.setup_bert_encoder(force_reload=False, out=False)

_b5.load_text_model_hc(corpus=corpus, out=False)
url = _b5.weights_for_big5_["text"][corpus]["hc"]["sberdisk"]
url = _b5.weights_for_big5_["text"][corpus]["hc"][DISK]
_b5.load_text_model_weights_hc(url=url, out=False)

_b5.load_text_model_nn(corpus=corpus, out=False)
url = _b5.weights_for_big5_["text"][corpus]["nn"]["sberdisk"]
url = _b5.weights_for_big5_["text"][corpus]["nn"][DISK]
_b5.load_text_model_weights_nn(url=url, out=False)

_b5.load_text_model_b5(out=False)
url = _b5.weights_for_big5_["text"][corpus]["b5"]["sberdisk"]
url = _b5.weights_for_big5_["text"][corpus]["b5"][DISK]
_b5.load_text_model_weights_b5(url=url, out=False)

_b5.get_text_union_predictions(lang=lang, url_accuracy=URL_ACCURACY, out=False)
Expand All @@ -180,31 +181,31 @@ def test_get_av_union_predictions():
_b5.load_audio_model_hc(out=False)
_b5.load_audio_model_nn(out=False)

url = _b5.weights_for_big5_["audio"][corpus]["hc"]["sberdisk"]
url = _b5.weights_for_big5_["audio"][corpus]["hc"][DISK]
_b5.load_audio_model_weights_hc(url=url, out=False)

url = _b5.weights_for_big5_["audio"][corpus]["nn"]["sberdisk"]
url = _b5.weights_for_big5_["audio"][corpus]["nn"][DISK]
_b5.load_audio_model_weights_nn(url=url, out=False)

_b5.load_video_model_hc(lang=lang, out=False)
_b5.load_video_model_deep_fe(out=False)
_b5.load_video_model_nn(out=False)

url = _b5.weights_for_big5_["video"][corpus]["hc"]["sberdisk"]
url = _b5.weights_for_big5_["video"][corpus]["hc"][DISK]
_b5.load_video_model_weights_hc(url=url, out=False)

url = _b5.weights_for_big5_["video"][corpus]["fe"]["sberdisk"]
url = _b5.weights_for_big5_["video"][corpus]["fe"][DISK]
_b5.load_video_model_weights_deep_fe(url=url, out=False)

url = _b5.weights_for_big5_["video"][corpus]["nn"]["sberdisk"]
url = _b5.weights_for_big5_["video"][corpus]["nn"][DISK]
_b5.load_video_model_weights_nn(url=url, out=False)

_b5.load_av_models_b5(out=False)
url_openness = _b5.weights_for_big5_["av"][corpus]["b5"]["openness"]["sberdisk"]
url_conscientiousness = _b5.weights_for_big5_["av"][corpus]["b5"]["conscientiousness"]["sberdisk"]
url_extraversion = _b5.weights_for_big5_["av"][corpus]["b5"]["extraversion"]["sberdisk"]
url_agreeableness = _b5.weights_for_big5_["av"][corpus]["b5"]["agreeableness"]["sberdisk"]
url_non_neuroticism = _b5.weights_for_big5_["av"][corpus]["b5"]["non_neuroticism"]["sberdisk"]
url_openness = _b5.weights_for_big5_["av"][corpus]["b5"]["openness"][DISK]
url_conscientiousness = _b5.weights_for_big5_["av"][corpus]["b5"]["conscientiousness"][DISK]
url_extraversion = _b5.weights_for_big5_["av"][corpus]["b5"]["extraversion"][DISK]
url_agreeableness = _b5.weights_for_big5_["av"][corpus]["b5"]["agreeableness"][DISK]
url_non_neuroticism = _b5.weights_for_big5_["av"][corpus]["b5"]["non_neuroticism"][DISK]
_b5.load_av_models_weights_b5(
url_openness=url_openness,
url_conscientiousness=url_conscientiousness,
Expand All @@ -226,39 +227,39 @@ def test_get_avt_predictions():
_b5.load_audio_model_hc(out=False)
_b5.load_audio_model_nn(out=False)

url = _b5.weights_for_big5_["audio"][corpus]["hc"]["sberdisk"]
url = _b5.weights_for_big5_["audio"][corpus]["hc"][DISK]
_b5.load_audio_model_weights_hc(url=url, out=False)

url = _b5.weights_for_big5_["audio"][corpus]["nn"]["sberdisk"]
url = _b5.weights_for_big5_["audio"][corpus]["nn"][DISK]
_b5.load_audio_model_weights_nn(url=url, out=False)

_b5.load_video_model_hc(lang=lang, out=False)
_b5.load_video_model_deep_fe(out=False)
_b5.load_video_model_nn(out=False)

url = _b5.weights_for_big5_["video"][corpus]["hc"]["sberdisk"]
url = _b5.weights_for_big5_["video"][corpus]["hc"][DISK]
_b5.load_video_model_weights_hc(url=url, out=False)

url = _b5.weights_for_big5_["video"][corpus]["fe"]["sberdisk"]
url = _b5.weights_for_big5_["video"][corpus]["fe"][DISK]
_b5.load_video_model_weights_deep_fe(url=url, out=False)

url = _b5.weights_for_big5_["video"][corpus]["nn"]["sberdisk"]
url = _b5.weights_for_big5_["video"][corpus]["nn"][DISK]
_b5.load_video_model_weights_nn(url=url, out=False)

_b5.load_text_features(out=False)
_b5.setup_translation_model(out=False)
_b5.setup_bert_encoder(force_reload=False, out=False)

_b5.load_text_model_hc(corpus=corpus, out=False)
url = _b5.weights_for_big5_["text"][corpus]["hc"]["sberdisk"]
url = _b5.weights_for_big5_["text"][corpus]["hc"][DISK]
_b5.load_text_model_weights_hc(url=url, out=False)

_b5.load_text_model_nn(corpus=corpus, out=False)
url = _b5.weights_for_big5_["text"][corpus]["nn"]["sberdisk"]
url = _b5.weights_for_big5_["text"][corpus]["nn"][DISK]
_b5.load_text_model_weights_nn(url=url, out=False)

_b5.load_avt_model_b5(out=False)
url = _b5.weights_for_big5_["avt"][corpus]["b5"]["sberdisk"]
url = _b5.weights_for_big5_["avt"][corpus]["b5"][DISK]
_b5.load_avt_model_weights_b5(url=url, out=False)

_b5.get_avt_predictions(url_accuracy=URL_ACCURACY, lang=lang, out=False)
Expand Down
Loading