DmitryRyumin commited on
Commit
506641f
1 Parent(s): d02f294
app/event_handlers/calculate_practical_tasks.py CHANGED
@@ -662,37 +662,89 @@ def event_handler_calculate_practical_task_blocks(
662
  elif (
663
  practical_subtasks.lower() == "finding a suitable junior colleague"
664
  or practical_subtasks.lower() == "finding a suitable senior colleague"
 
 
665
  ):
666
- df_correlation_coefficients = read_csv_file(
667
- config_data.Links_FINDING_COLLEAGUE, ["ID"]
668
- )
669
 
670
- b5._colleague_ranking(
671
- df_files=pt_scores.iloc[:, 1:],
672
- correlation_coefficients=df_correlation_coefficients,
673
- target_scores=[
674
- target_score_ope,
675
- target_score_con,
676
- target_score_ext,
677
- target_score_agr,
678
- target_score_nneu,
679
- ],
680
- colleague=colleague_type(practical_subtasks),
681
- equal_coefficients=equal_coefficient,
682
- out=False,
683
- )
684
 
685
- df = apply_rounding_and_rename_columns(b5.df_files_colleague_)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
686
 
687
- df_hidden = df.drop(columns=config_data.Settings_SHORT_PROFESSIONAL_SKILLS)
688
 
689
- df_hidden.to_csv(
690
- colleague_type(practical_subtasks) + config_data.Filenames_COLLEAGUE_RANKING
691
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
692
 
693
  df_hidden.reset_index(inplace=True)
694
 
695
- person_id = int(df_hidden.iloc[0][config_data.Dataframes_PT_SCORES[0][0]]) - 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
696
 
697
  person_metadata = create_person_metadata(person_id, files, video_metadata)
698
 
 
662
  elif (
663
  practical_subtasks.lower() == "finding a suitable junior colleague"
664
  or practical_subtasks.lower() == "finding a suitable senior colleague"
665
+ or practical_subtasks.lower()
666
+ == "finding a suitable colleague by personality types"
667
  ):
668
+ pt_scores_copy = pt_scores.iloc[:, 1:].copy()
 
 
669
 
670
+ preprocess_scores_df(pt_scores_copy, config_data.Dataframes_PT_SCORES[0][0])
671
+
672
+ if (
673
+ practical_subtasks.lower()
674
+ != "finding a suitable colleague by personality types"
675
+ ):
676
+ df_correlation_coefficients = read_csv_file(
677
+ config_data.Links_FINDING_COLLEAGUE, ["ID"]
678
+ )
 
 
 
 
 
679
 
680
+ b5._colleague_ranking(
681
+ df_files=pt_scores_copy,
682
+ correlation_coefficients=df_correlation_coefficients,
683
+ target_scores=[
684
+ target_score_ope,
685
+ target_score_con,
686
+ target_score_ext,
687
+ target_score_agr,
688
+ target_score_nneu,
689
+ ],
690
+ colleague=colleague_type(practical_subtasks),
691
+ equal_coefficients=equal_coefficient,
692
+ out=False,
693
+ )
694
+ df = apply_rounding_and_rename_columns(b5.df_files_colleague_)
695
 
696
+ df_hidden = df.drop(columns=config_data.Settings_SHORT_PROFESSIONAL_SKILLS)
697
 
698
+ df_hidden.to_csv(
699
+ colleague_type(practical_subtasks)
700
+ + config_data.Filenames_COLLEAGUE_RANKING
701
+ )
702
+ else:
703
+ b5._colleague_personality_type_match(
704
+ df_files=pt_scores_copy,
705
+ correlation_coefficients=None,
706
+ target_scores=[
707
+ target_score_ope,
708
+ target_score_con,
709
+ target_score_ext,
710
+ target_score_agr,
711
+ target_score_nneu,
712
+ ],
713
+ threshold=equal_coefficient,
714
+ out=False,
715
+ )
716
+ df = b5.df_files_MBTI_colleague_match_.rename(
717
+ columns={
718
+ "MBTI": "Personality Type",
719
+ "MBTI_Score": "Personality Type Score",
720
+ }
721
+ )
722
+
723
+ df_hidden = df[["Path", "Personality Type", "Match"]]
724
+
725
+ df_hidden.to_csv(config_data.Filenames_COLLEAGUE_RANKING)
726
 
727
  df_hidden.reset_index(inplace=True)
728
 
729
+ if (
730
+ practical_subtasks.lower()
731
+ != "finding a suitable colleague by personality types"
732
+ ):
733
+ person_id = (
734
+ int(
735
+ df_hidden.iloc[
736
+ (
737
+ 0
738
+ if practical_subtasks.lower()
739
+ != "finding a suitable colleague by personality types"
740
+ else 1
741
+ )
742
+ ][config_data.Dataframes_PT_SCORES[0][0]]
743
+ )
744
+ - 1
745
+ )
746
+ else:
747
+ person_id = 0
748
 
749
  person_metadata = create_person_metadata(person_id, files, video_metadata)
750
 
app/event_handlers/practical_subtasks.py CHANGED
@@ -219,6 +219,8 @@ def event_handler_practical_subtasks(
219
  elif (
220
  practical_subtasks.lower() == "finding a suitable junior colleague"
221
  or practical_subtasks.lower() == "finding a suitable senior colleague"
 
 
222
  ):
223
  return (
224
  practical_subtasks_selected,
@@ -297,7 +299,12 @@ def event_handler_practical_subtasks(
297
  minimum=0.0,
298
  maximum=1.0,
299
  step=0.01,
300
- label=config_data.Labels_EQUAL_COEFFICIENT_LABEL,
 
 
 
 
 
301
  info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(0, 1.0),
302
  show_label=True,
303
  interactive=True,
 
219
  elif (
220
  practical_subtasks.lower() == "finding a suitable junior colleague"
221
  or practical_subtasks.lower() == "finding a suitable senior colleague"
222
+ or practical_subtasks.lower()
223
+ == "finding a suitable colleague by personality types"
224
  ):
225
  return (
226
  practical_subtasks_selected,
 
299
  minimum=0.0,
300
  maximum=1.0,
301
  step=0.01,
302
+ label=(
303
+ config_data.Labels_THRESHOLD_TARGET_SCORE_LABEL
304
+ if practical_subtasks.lower()
305
+ == "finding a suitable colleague by personality types"
306
+ else config_data.Labels_EQUAL_COEFFICIENT_LABEL
307
+ ),
308
  info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(0, 1.0),
309
  show_label=True,
310
  interactive=True,
config.toml CHANGED
@@ -1,5 +1,5 @@
1
  [AppSettings]
2
- APP_VERSION = "0.10.8"
3
  SERVER_NAME = "127.0.0.1"
4
  PORT = 7860
5
  CSS_PATH = "app.css"
@@ -72,6 +72,7 @@ TARGET_SCORE_EXT_LABEL = "Extraversion target score"
72
  TARGET_SCORE_AGR_LABEL = "Agreeableness target score"
73
  TARGET_SCORE_NNEU_LABEL = "Non-Neuroticism target score"
74
  EQUAL_COEFFICIENT_LABEL = "Equal coefficient"
 
75
  NUMBER_PRIORITY_LABEL = "Priority number"
76
  NUMBER_IMPORTANCE_TRAITS_LABEL = "Importance traits number"
77
  NUMBER_IMPORTANCE_OPE_LABEL = "Openness weight"
 
1
  [AppSettings]
2
+ APP_VERSION = "0.10.9"
3
  SERVER_NAME = "127.0.0.1"
4
  PORT = 7860
5
  CSS_PATH = "app.css"
 
72
  TARGET_SCORE_AGR_LABEL = "Agreeableness target score"
73
  TARGET_SCORE_NNEU_LABEL = "Non-Neuroticism target score"
74
  EQUAL_COEFFICIENT_LABEL = "Equal coefficient"
75
+ THRESHOLD_TARGET_SCORE_LABEL = "Polarity traits threshold"
76
  NUMBER_PRIORITY_LABEL = "Priority number"
77
  NUMBER_IMPORTANCE_TRAITS_LABEL = "Importance traits number"
78
  NUMBER_IMPORTANCE_OPE_LABEL = "Openness weight"
practical_tasks_en.yaml CHANGED
@@ -7,6 +7,7 @@
7
  subtasks:
8
  - "Finding a suitable junior colleague"
9
  - "Finding a suitable senior colleague"
 
10
  - task: "Predicting consumer preferences for industrial goods"
11
  subtasks:
12
  - "Car characteristics"
 
7
  subtasks:
8
  - "Finding a suitable junior colleague"
9
  - "Finding a suitable senior colleague"
10
+ - "Finding a suitable colleague by personality types"
11
  - task: "Predicting consumer preferences for industrial goods"
12
  subtasks:
13
  - "Car characteristics"
practical_tasks_ru.yaml CHANGED
@@ -7,6 +7,7 @@
7
  subtasks:
8
  - "Поиск подходящего младшего коллеги"
9
  - "Поиск подходящего старшего коллеги"
 
10
  - task: "Прогнозирование потребительских предпочтений в отношении промышленных товаров"
11
  subtasks:
12
  - "Характеристики автомобиля"
 
7
  subtasks:
8
  - "Поиск подходящего младшего коллеги"
9
  - "Поиск подходящего старшего коллеги"
10
+ - "Поиск подходящего коллеги по типам личности"
11
  - task: "Прогнозирование потребительских предпочтений в отношении промышленных товаров"
12
  subtasks:
13
  - "Характеристики автомобиля"