DmitryRyumin commited on
Commit
f505de3
1 Parent(s): 11ee11f
app.css CHANGED
@@ -10,6 +10,11 @@ div.video-container {
10
  max-height: 350px;
11
  }
12
 
 
 
 
 
 
13
  div.files-container {
14
  height: 350px;
15
  max-height: 350px;
@@ -95,6 +100,47 @@ div.files-container label[data-testid="block-label"] {
95
  max-width: fit-content;
96
  }
97
 
 
 
 
 
98
  .dropdown-container > div > span[data-testid="block-info"] + div {
99
  min-width: max-content;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  }
 
10
  max-height: 350px;
11
  }
12
 
13
+ div.video-sorted-container {
14
+ max-width: 640px;
15
+ max-height: 350px;
16
+ }
17
+
18
  div.files-container {
19
  height: 350px;
20
  max-height: 350px;
 
100
  max-width: fit-content;
101
  }
102
 
103
+ .dropdown-language-container {
104
+ display: contents;
105
+ }
106
+
107
  .dropdown-container > div > span[data-testid="block-info"] + div {
108
  min-width: max-content;
109
+ }
110
+
111
+ div.gradio-container > div.main > div.wrap > div.contain > #component-0 > div.form {
112
+ display: flex;
113
+ width: fit-content;
114
+ float: left;
115
+ right: 0px;
116
+ position: absolute;
117
+ z-index: 2;
118
+ }
119
+
120
+ div.gradio-container > div.main > div.wrap > div.contain > #component-0 > div.tabs {
121
+ margin-top: 20px;
122
+ }
123
+
124
+ div.dataframe span.wrapper_mbti {
125
+ display: inline-block;
126
+ border-radius: 2px;
127
+ overflow: hidden;
128
+ }
129
+
130
+ div.dataframe span.wrapper_mbti > span.true, div.dataframe span.wrapper_mbti > span.err {
131
+ color: #FFFFFF;
132
+ display: inline-block;
133
+ padding: 2px;
134
+ }
135
+
136
+ div.dataframe span.wrapper_mbti > span.true {
137
+ background-color: #006900;
138
+ }
139
+
140
+ div.dataframe span.wrapper_mbti > span.err {
141
+ background-color: #B42E2C;
142
+ }
143
+
144
+ div.mbti-dataframe div.table-wrap {
145
+ --cell-width-0: 260px !important;
146
  }
app.py CHANGED
@@ -11,11 +11,24 @@ import gradio as gr
11
  from app.config import CONFIG_NAME, config_data, load_tab_creators
12
  from app.event_handlers.event_handlers import setup_app_event_handlers
13
  from app import tabs
 
14
 
15
 
16
  def create_gradio_app() -> gr.Blocks:
17
  with gr.Blocks(css=config_data.AppSettings_CSS_PATH) as gradio_app:
 
 
 
 
 
 
 
 
 
 
 
18
  tab_results = {}
 
19
 
20
  available_functions = {
21
  attr: getattr(tabs, attr)
@@ -26,11 +39,14 @@ def create_gradio_app() -> gr.Blocks:
26
  tab_creators = load_tab_creators(CONFIG_NAME, available_functions)
27
 
28
  for tab_name, create_tab_function in tab_creators.items():
29
- with gr.Tab(tab_name):
30
  app_instance = create_tab_function()
31
  tab_results[tab_name] = app_instance
 
32
 
33
- setup_app_event_handlers(*tab_results[list(tab_results.keys())[0]])
 
 
34
 
35
  return gradio_app
36
 
 
11
  from app.config import CONFIG_NAME, config_data, load_tab_creators
12
  from app.event_handlers.event_handlers import setup_app_event_handlers
13
  from app import tabs
14
+ from app.components import dropdown_create_ui
15
 
16
 
17
  def create_gradio_app() -> gr.Blocks:
18
  with gr.Blocks(css=config_data.AppSettings_CSS_PATH) as gradio_app:
19
+ languages = dropdown_create_ui(
20
+ label=None,
21
+ info=None,
22
+ choices=config_data.Settings_LANGUAGES_EN,
23
+ value=config_data.Settings_LANGUAGES_EN[0],
24
+ visible=True,
25
+ show_label=False,
26
+ elem_classes="dropdown-language-container",
27
+ interactive=False,
28
+ )
29
+
30
  tab_results = {}
31
+ ts = []
32
 
33
  available_functions = {
34
  attr: getattr(tabs, attr)
 
39
  tab_creators = load_tab_creators(CONFIG_NAME, available_functions)
40
 
41
  for tab_name, create_tab_function in tab_creators.items():
42
+ with gr.Tab(tab_name) as tab:
43
  app_instance = create_tab_function()
44
  tab_results[tab_name] = app_instance
45
+ ts.append(tab)
46
 
47
+ setup_app_event_handlers(
48
+ *tab_results[list(tab_results.keys())[0]], *ts, languages
49
+ )
50
 
51
  return gradio_app
52
 
app/authors.py CHANGED
@@ -12,16 +12,27 @@ AUTHORS = """
12
  <img src="https://readme-typing-svg.demolab.com?font=Roboto&duration=1500&pause=100&color=3081F7&vCenter=true&multiline=true&width=435&height=70&lines=Elena+Ryumina;Artificial+Intelligence+Researcher" alt="ElenaRyumina" />
13
  </a>
14
  <div style="display: flex; margin-bottom: 6px;">
15
- <a href="https://www.scopus.com/authid/detail.uri?authorId=57220572427">
16
- <img src="https://img.shields.io/badge/Scopus-%23E9711C.svg?&style=flat-square&logo=scopus&logoColor=white" alt="" style="margin-right: 6px;" />
17
  </a>
18
- <a href="https://scholar.google.com/citations?user=DOBkQssAAAAJ">
19
- <img src="https://img.shields.io/badge/Google%20Scholar-%234285F4.svg?&style=flat-square&logo=google-scholar&logoColor=white" alt="" style="margin-right: 6px;" />
 
 
 
20
  </a>
21
  <a href="https://orcid.org/0000-0002-4135-6949">
22
  <img src="https://img.shields.io/badge/ORCID-0000--0002--4135--6949-green.svg?&style=flat-square&logo=orcid&logoColor=white" alt="" />
23
  </a>
24
  </div>
 
 
 
 
 
 
 
 
25
  <a href="https://github.com/ElenaRyumina" style="display: inline-block;">
26
  <img src="https://github-stats-alpha.vercel.app/api?username=ElenaRyumina&cc=3081F7&tc=FFFFFF&ic=FFFFFF&bc=FFFFFF" alt="" />
27
  </a>
@@ -35,20 +46,31 @@ AUTHORS = """
35
  <img src="https://readme-typing-svg.demolab.com?font=Roboto&duration=1500&pause=100&color=3081F7&vCenter=true&multiline=true&width=435&height=70&lines=Dr.+Dmitry+Ryumin;Artificial+Intelligence+Researcher" alt="DmitryRyumin" />
36
  </a>
37
  <div style="display: flex; margin-bottom: 6px;">
38
- <a href="https://dmitryryumin.github.io">
39
- <img src="https://img.shields.io/badge/Website-blue??&style=flat-square&logo=opsgenie&logoColor=white" alt="" style="margin-right: 6px;" />
40
  </a>
41
- <a href="https://www.scopus.com/authid/detail.uri?authorId=57191960214">
42
- <img src="https://img.shields.io/badge/Scopus-%23E9711C.svg?&style=flat-square&logo=scopus&logoColor=white" alt="" style="margin-right: 6px;" />
43
  </a>
44
- <a href="https://scholar.google.com/citations?user=LrTIp5IAAAAJ">
45
- <img src="https://img.shields.io/badge/Google%20Scholar-%234285F4.svg?&style=flat-square&logo=google-scholar&logoColor=white" alt="" style="margin-right: 6px;" />
 
 
 
46
  </a>
47
  <a href="https://orcid.org/0000-0002-7935-0569">
48
- <img src="https://img.shields.io/badge/ORCID-0000--0002--7935--0569-green.svg?&style=flat-square&logo=orcid&logoColor=white" alt="" style="margin-right: 6px;" />
 
 
 
 
 
 
 
 
49
  </a>
50
  <a href="mailto:neweraairesearch@gmail.com">
51
- <img src="https://img.shields.io/badge/-Email-red?style=flat-square&logo=gmail&logoColor=white" alt="" />
52
  </a>
53
  </div>
54
  <a href="https://github.com/DmitryRyumin" style="display: inline-block;">
@@ -60,4 +82,29 @@ AUTHORS = """
60
  </div>
61
  </div>
62
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  """
 
12
  <img src="https://readme-typing-svg.demolab.com?font=Roboto&duration=1500&pause=100&color=3081F7&vCenter=true&multiline=true&width=435&height=70&lines=Elena+Ryumina;Artificial+Intelligence+Researcher" alt="ElenaRyumina" />
13
  </a>
14
  <div style="display: flex; margin-bottom: 6px;">
15
+ <a href="https://www.webofscience.com/wos/author/record/ABY-9103-2022" style="margin-right: 6px;">
16
+ <img src="https://img.shields.io/badge/Web%20of%20Science-5D34BF??&style=flat-square&logo=clarivate&logoColor=white" alt="" />
17
  </a>
18
+ <a href="https://www.scopus.com/authid/detail.uri?authorId=57220572427" style="margin-right: 6px;">
19
+ <img src="https://img.shields.io/badge/Scopus-%23E9711C.svg?&style=flat-square&logo=scopus&logoColor=white" alt="" />
20
+ </a>
21
+ <a href="https://scholar.google.com/citations?user=DOBkQssAAAAJ" style="margin-right: 6px;">
22
+ <img src="https://img.shields.io/badge/Google%20Scholar-%234285F4.svg?&style=flat-square&logo=google-scholar&logoColor=white" alt="" />
23
  </a>
24
  <a href="https://orcid.org/0000-0002-4135-6949">
25
  <img src="https://img.shields.io/badge/ORCID-0000--0002--4135--6949-green.svg?&style=flat-square&logo=orcid&logoColor=white" alt="" />
26
  </a>
27
  </div>
28
+ <div style="display: flex; margin-bottom: 6px;">
29
+ <a href="https://huggingface.co/ElenaRyumina" style="margin-right: 6px;">
30
+ <img src="https://img.shields.io/badge/🤗-Hugging%20Face-FFD21F.svg?style=flat-square&&logoColor=white" alt="" />
31
+ </a>
32
+ <a href="mailto:ryumina_ev@mail.ru">
33
+ <img src="https://img.shields.io/badge/-Email-red?style=flat-square&logo=gmail&logoColor=white" alt="" />
34
+ </a>
35
+ </div>
36
  <a href="https://github.com/ElenaRyumina" style="display: inline-block;">
37
  <img src="https://github-stats-alpha.vercel.app/api?username=ElenaRyumina&cc=3081F7&tc=FFFFFF&ic=FFFFFF&bc=FFFFFF" alt="" />
38
  </a>
 
46
  <img src="https://readme-typing-svg.demolab.com?font=Roboto&duration=1500&pause=100&color=3081F7&vCenter=true&multiline=true&width=435&height=70&lines=Dr.+Dmitry+Ryumin;Artificial+Intelligence+Researcher" alt="DmitryRyumin" />
47
  </a>
48
  <div style="display: flex; margin-bottom: 6px;">
49
+ <a href="https://dmitryryumin.github.io" style="margin-right: 6px;">
50
+ <img src="https://img.shields.io/badge/Website-blue??&style=flat-square&logo=opsgenie&logoColor=white" alt="" />
51
  </a>
52
+ <a href="https://www.webofscience.com/wos/author/record/K-7989-2018" style="margin-right: 6px;">
53
+ <img src="https://img.shields.io/badge/Web%20of%20Science-5D34BF??&style=flat-square&logo=clarivate&logoColor=white" alt="" />
54
  </a>
55
+ <a href="https://www.scopus.com/authid/detail.uri?authorId=57191960214" style="margin-right: 6px;">
56
+ <img src="https://img.shields.io/badge/Scopus-%23E9711C.svg?&style=flat-square&logo=scopus&logoColor=white" alt="" />
57
+ </a>
58
+ <a href="https://scholar.google.com/citations?user=LrTIp5IAAAAJ" style="margin-right: 6px;">
59
+ <img src="https://img.shields.io/badge/Google%20Scholar-%234285F4.svg?&style=flat-square&logo=google-scholar&logoColor=white" alt="" />
60
  </a>
61
  <a href="https://orcid.org/0000-0002-7935-0569">
62
+ <img src="https://img.shields.io/badge/ORCID-0000--0002--7935--0569-green.svg?&style=flat-square&logo=orcid&logoColor=white" alt="" />
63
+ </a>
64
+ </div>
65
+ <div style="display: flex; margin-bottom: 6px;">
66
+ <a href="https://huggingface.co/DmitryRyumin" style="margin-right: 6px;">
67
+ <img src="https://img.shields.io/badge/🤗-Hugging%20Face-FFD21F.svg?style=flat-square&&logoColor=white" alt="" />
68
+ </a>
69
+ <a href="https://t.me/dmitry_ryumin" style="margin-right: 6px;">
70
+ <img src="https://img.shields.io/badge/Telegram-2CA5E0?style=flat-square&logo=telegram&logoColor=white" alt="" />
71
  </a>
72
  <a href="mailto:neweraairesearch@gmail.com">
73
+ <img src="https://img.shields.io/badge/-Email-red?style=flat-square&logo=gmail&logoColor=white" alt=""/>
74
  </a>
75
  </div>
76
  <a href="https://github.com/DmitryRyumin" style="display: inline-block;">
 
82
  </div>
83
  </div>
84
  </div>
85
+ <div style="display: flex; justify-content: center; align-items: center; margin-top: 10px;">
86
+ <img src="https://hci.nw.ru/storage/employees/first/Karpov.jpg" alt="Professor Alexey Karpov" style="margin-right: 20px; border-radius: 50%; width: 80px; height: 80px; object-fit: cover;">
87
+ <div style="flex-basis: 40%;">
88
+ <a href="https://hci.nw.ru/en/employees/1" style="display: inline-block;">
89
+ <img src="https://readme-typing-svg.demolab.com?font=Roboto&duration=1500&pause=100&color=3081F7&vCenter=true&multiline=true&width=435&height=70&lines=Dr.Sc.+Alexey+Karpov;Supervisor" alt="AlexeyKarpov" />
90
+ </a>
91
+ <div style="display: flex; margin-bottom: 6px;">
92
+ <a href="https://www.webofscience.com/wos/author/record/A-8905-2012" style="margin-right: 6px;">
93
+ <img src="https://img.shields.io/badge/Web%20of%20Science-5D34BF??&style=flat-square&logo=clarivate&logoColor=white" alt="" />
94
+ </a>
95
+ <a href="https://www.scopus.com/authid/detail.uri?authorId=57219469958" style="margin-right: 6px;">
96
+ <img src="https://img.shields.io/badge/Scopus-%23E9711C.svg?&style=flat-square&logo=scopus&logoColor=white" alt="" />
97
+ </a>
98
+ <a href="https://scholar.google.com/citations?user=Q0C3f1oAAAAJ" style="margin-right: 6px;">
99
+ <img src="https://img.shields.io/badge/Google%20Scholar-%234285F4.svg?&style=flat-square&logo=google-scholar&logoColor=white" alt="" />
100
+ </a>
101
+ <a href="https://orcid.org/0000-0003-3424-652X" style="margin-right: 6px;">
102
+ <img src="https://img.shields.io/badge/ORCID-0000--0003--3424--652X-green.svg?&style=flat-square&logo=orcid&logoColor=white" alt="" />
103
+ </a>
104
+ <a href="mailto:karpov@iias.spb.su">
105
+ <img src="https://img.shields.io/badge/-Email-red?style=flat-square&logo=gmail&logoColor=white" alt="" />
106
+ </a>
107
+ </div>
108
+ </div>
109
+ </div>
110
  """
app/description.py CHANGED
@@ -1,6 +1,6 @@
1
  """
2
  File: description.py
3
- Author: Dmitry Ryumin
4
  Description: Project description for the Gradio app.
5
  License: MIT License
6
  """
 
1
  """
2
  File: description.py
3
+ Author: Elena Ryumina and Dmitry Ryumin
4
  Description: Project description for the Gradio app.
5
  License: MIT License
6
  """
app/description_steps.py CHANGED
@@ -1,7 +1,7 @@
1
  """
2
- File: description.py
3
- Author: Dmitry Ryumin
4
- Description: Project description for the Gradio app.
5
  License: MIT License
6
  """
7
 
 
1
  """
2
+ File: description_steps.py
3
+ Author: Elena Ryumina and Dmitry Ryumin
4
+ Description: Project steps description for the Gradio app.
5
  License: MIT License
6
  """
7
 
app/event_handlers/calculate_practical_tasks.py CHANGED
@@ -6,11 +6,13 @@ License: MIT License
6
  """
7
 
8
  from app.oceanai_init import b5
 
9
  import gradio as gr
10
  from pathlib import Path
11
 
12
  # Importing necessary components for the Gradio app
13
  from app.config import config_data
 
14
  from app.utils import (
15
  read_csv_file,
16
  apply_rounding_and_rename_columns,
@@ -31,10 +33,39 @@ def consumer_preferences(subtask):
31
  )
32
 
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  def event_handler_calculate_practical_task_blocks(
35
  files,
36
  practical_subtasks,
37
  pt_scores,
 
 
38
  threshold_professional_skills,
39
  dropdown_professional_skills,
40
  target_score_ope,
@@ -52,7 +83,79 @@ def event_handler_calculate_practical_task_blocks(
52
  number_agreeableness,
53
  number_non_neuroticism,
54
  ):
55
- if practical_subtasks.lower() == "professional groups":
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  sum_weights = sum(
57
  [
58
  number_openness,
@@ -80,6 +183,9 @@ def event_handler_calculate_practical_task_blocks(
80
  False,
81
  "csv-container",
82
  ),
 
 
 
83
  video_create_ui(visible=False),
84
  html_message(
85
  config_data.InformationMessages_SUM_WEIGHTS.format(sum_weights),
@@ -126,11 +232,15 @@ def event_handler_calculate_practical_task_blocks(
126
  True,
127
  "csv-container",
128
  ),
 
 
 
129
  video_create_ui(
130
  value=files[person_id],
131
  file_name=Path(files[person_id]).name,
132
  label="Best Person ID - " + str(person_id + 1),
133
  visible=True,
 
134
  ),
135
  html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
136
  )
@@ -185,11 +295,15 @@ def event_handler_calculate_practical_task_blocks(
185
  True,
186
  "csv-container",
187
  ),
 
 
 
188
  video_create_ui(
189
  value=files[person_id],
190
  file_name=Path(files[person_id]).name,
191
  label="Best Person ID - " + str(person_id + 1),
192
  visible=True,
 
193
  ),
194
  html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
195
  )
@@ -247,27 +361,34 @@ def event_handler_calculate_practical_task_blocks(
247
  True,
248
  "csv-container",
249
  ),
 
 
 
250
  video_create_ui(
251
  value=files[person_id],
252
  file_name=Path(files[person_id]).name,
253
  label="Best Person ID - " + str(person_id + 1),
254
  visible=True,
 
255
  ),
256
  html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
257
  )
258
  elif (
259
  practical_subtasks.lower() == "car characteristics"
260
  or practical_subtasks.lower() == "mobile device application categories"
 
261
  ):
262
  if practical_subtasks.lower() == "car characteristics":
263
  df_correlation_coefficients = read_csv_file(
264
  config_data.Links_CAR_CHARACTERISTICS,
265
  ["Style and performance", "Safety and practicality"],
266
  )
267
- if practical_subtasks.lower() == "mobile device application categories":
268
  df_correlation_coefficients = read_csv_file(
269
  config_data.Links_MDA_CATEGORIES
270
  )
 
 
271
 
272
  pt_scores_copy = pt_scores.iloc[:, 1:].copy()
273
 
@@ -316,11 +437,15 @@ def event_handler_calculate_practical_task_blocks(
316
  True,
317
  "csv-container",
318
  ),
 
 
 
319
  video_create_ui(
320
  value=files[person_id],
321
  file_name=Path(files[person_id]).name,
322
  label="Best Person ID - " + str(person_id + 1),
323
  visible=True,
 
324
  ),
325
  html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
326
  )
@@ -341,6 +466,9 @@ def event_handler_calculate_practical_task_blocks(
341
  False,
342
  "csv-container",
343
  ),
 
 
 
344
  video_create_ui(visible=False),
345
  html_message(config_data.InformationMessages_NOTI_IN_DEV, False, True),
346
  )
 
6
  """
7
 
8
  from app.oceanai_init import b5
9
+ import re
10
  import gradio as gr
11
  from pathlib import Path
12
 
13
  # Importing necessary components for the Gradio app
14
  from app.config import config_data
15
+ from app.mbti_description import MBTI_DESCRIPTION, MBTI_DATA
16
  from app.utils import (
17
  read_csv_file,
18
  apply_rounding_and_rename_columns,
 
33
  )
34
 
35
 
36
+ def remove_parentheses(s):
37
+ return re.sub(r"\s*\([^)]*\)", "", s)
38
+
39
+
40
+ def extract_text_in_parentheses(s):
41
+ result = re.search(r"\(([^)]+)\)", s)
42
+ if result:
43
+ return result.group(1)
44
+ else:
45
+ return None
46
+
47
+
48
+ def compare_strings(original, comparison):
49
+ result = []
50
+ prev_class = None
51
+
52
+ for orig_char, comp_char in zip(original, comparison):
53
+ curr_class = "true" if orig_char == comp_char else "err"
54
+ if curr_class != prev_class:
55
+ result.append("</span>" if prev_class else "")
56
+ result.append(f"<span class='{curr_class}'>")
57
+ prev_class = curr_class
58
+ result.append(comp_char)
59
+
60
+ return f"<span class='wrapper_mbti'>{''.join(result + [f'</span>' if prev_class else ''])}</span>"
61
+
62
+
63
  def event_handler_calculate_practical_task_blocks(
64
  files,
65
  practical_subtasks,
66
  pt_scores,
67
+ dropdown_mbti,
68
+ threshold_mbti,
69
  threshold_professional_skills,
70
  dropdown_professional_skills,
71
  target_score_ope,
 
83
  number_agreeableness,
84
  number_non_neuroticism,
85
  ):
86
+ if practical_subtasks.lower() == "sixteen myers-briggs personality type indicators":
87
+ df_correlation_coefficients = read_csv_file(config_data.Links_MBTI)
88
+
89
+ pt_scores_copy = pt_scores.iloc[:, 1:].copy()
90
+
91
+ preprocess_scores_df(pt_scores_copy, "Person ID")
92
+
93
+ b5._professional_match(
94
+ df_files=pt_scores_copy,
95
+ correlation_coefficients=df_correlation_coefficients,
96
+ personality_type=remove_parentheses(dropdown_mbti),
97
+ threshold=threshold_mbti,
98
+ out=False,
99
+ )
100
+
101
+ df = apply_rounding_and_rename_columns(b5.df_files_MBTI_job_match_)
102
+
103
+ df_hidden = df.drop(
104
+ columns=config_data.Settings_SHORT_PROFESSIONAL_SKILLS
105
+ + config_data.Settings_DROPDOWN_MBTI_DEL_COLS
106
+ )
107
+
108
+ df_hidden.to_csv(config_data.Filenames_MBTI_JOB)
109
+
110
+ df_hidden.reset_index(inplace=True)
111
+
112
+ person_id = int(df_hidden.iloc[0]["Person ID"]) - 1
113
+
114
+ short_mbti = extract_text_in_parentheses(dropdown_mbti)
115
+ mbti_values = df_hidden["MBTI"].tolist()
116
+
117
+ df_hidden["MBTI"] = [compare_strings(short_mbti, mbti) for mbti in mbti_values]
118
+
119
+ return (
120
+ gr.Row(visible=True),
121
+ gr.Column(visible=True),
122
+ dataframe(
123
+ headers=df_hidden.columns.tolist(),
124
+ values=df_hidden.values.tolist(),
125
+ visible=True,
126
+ ),
127
+ files_create_ui(
128
+ config_data.Filenames_MBTI_JOB,
129
+ "single",
130
+ [".csv"],
131
+ config_data.OtherMessages_EXPORT_MBTI,
132
+ True,
133
+ False,
134
+ True,
135
+ "csv-container",
136
+ ),
137
+ gr.Accordion(
138
+ label=config_data.Labels_NOTE_MBTI_LABEL,
139
+ open=False,
140
+ visible=True,
141
+ ),
142
+ gr.HTML(value=MBTI_DESCRIPTION, visible=True),
143
+ dataframe(
144
+ headers=MBTI_DATA.columns.tolist(),
145
+ values=MBTI_DATA.values.tolist(),
146
+ visible=True,
147
+ elem_classes="mbti-dataframe",
148
+ ),
149
+ video_create_ui(
150
+ value=files[person_id],
151
+ file_name=Path(files[person_id]).name,
152
+ label="Best Person ID - " + str(person_id + 1),
153
+ visible=True,
154
+ elem_classes="video-sorted-container",
155
+ ),
156
+ html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
157
+ )
158
+ elif practical_subtasks.lower() == "professional groups":
159
  sum_weights = sum(
160
  [
161
  number_openness,
 
183
  False,
184
  "csv-container",
185
  ),
186
+ gr.Accordion(visible=False),
187
+ gr.HTML(visible=False),
188
+ dataframe(visible=False),
189
  video_create_ui(visible=False),
190
  html_message(
191
  config_data.InformationMessages_SUM_WEIGHTS.format(sum_weights),
 
232
  True,
233
  "csv-container",
234
  ),
235
+ gr.Accordion(visible=False),
236
+ gr.HTML(visible=False),
237
+ dataframe(visible=False),
238
  video_create_ui(
239
  value=files[person_id],
240
  file_name=Path(files[person_id]).name,
241
  label="Best Person ID - " + str(person_id + 1),
242
  visible=True,
243
+ elem_classes="video-sorted-container",
244
  ),
245
  html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
246
  )
 
295
  True,
296
  "csv-container",
297
  ),
298
+ gr.Accordion(visible=False),
299
+ gr.HTML(visible=False),
300
+ dataframe(visible=False),
301
  video_create_ui(
302
  value=files[person_id],
303
  file_name=Path(files[person_id]).name,
304
  label="Best Person ID - " + str(person_id + 1),
305
  visible=True,
306
+ elem_classes="video-sorted-container",
307
  ),
308
  html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
309
  )
 
361
  True,
362
  "csv-container",
363
  ),
364
+ gr.Accordion(visible=False),
365
+ gr.HTML(visible=False),
366
+ dataframe(visible=False),
367
  video_create_ui(
368
  value=files[person_id],
369
  file_name=Path(files[person_id]).name,
370
  label="Best Person ID - " + str(person_id + 1),
371
  visible=True,
372
+ elem_classes="video-sorted-container",
373
  ),
374
  html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
375
  )
376
  elif (
377
  practical_subtasks.lower() == "car characteristics"
378
  or practical_subtasks.lower() == "mobile device application categories"
379
+ or practical_subtasks.lower() == "clothing style correlation"
380
  ):
381
  if practical_subtasks.lower() == "car characteristics":
382
  df_correlation_coefficients = read_csv_file(
383
  config_data.Links_CAR_CHARACTERISTICS,
384
  ["Style and performance", "Safety and practicality"],
385
  )
386
+ elif practical_subtasks.lower() == "mobile device application categories":
387
  df_correlation_coefficients = read_csv_file(
388
  config_data.Links_MDA_CATEGORIES
389
  )
390
+ elif practical_subtasks.lower() == "clothing style correlation":
391
+ df_correlation_coefficients = read_csv_file(config_data.Links_CLOTHING_SC)
392
 
393
  pt_scores_copy = pt_scores.iloc[:, 1:].copy()
394
 
 
437
  True,
438
  "csv-container",
439
  ),
440
+ gr.Accordion(visible=False),
441
+ gr.HTML(visible=False),
442
+ dataframe(visible=False),
443
  video_create_ui(
444
  value=files[person_id],
445
  file_name=Path(files[person_id]).name,
446
  label="Best Person ID - " + str(person_id + 1),
447
  visible=True,
448
+ elem_classes="video-sorted-container",
449
  ),
450
  html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
451
  )
 
466
  False,
467
  "csv-container",
468
  ),
469
+ gr.Accordion(visible=False),
470
+ gr.HTML(visible=False),
471
+ dataframe(visible=False),
472
  video_create_ui(visible=False),
473
  html_message(config_data.InformationMessages_NOTI_IN_DEV, False, True),
474
  )
app/event_handlers/calculate_pt_scores_blocks.py CHANGED
@@ -90,6 +90,27 @@ def event_handler_calculate_pt_scores_blocks(files, evt_data: gr.EventData):
90
  render=True,
91
  ),
92
  gr.Column(visible=True),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  number_create_ui(visible=False),
94
  dropdown_create_ui(visible=False),
95
  number_create_ui(visible=False),
@@ -101,89 +122,12 @@ def event_handler_calculate_pt_scores_blocks(files, evt_data: gr.EventData):
101
  number_create_ui(visible=False),
102
  number_create_ui(visible=False),
103
  number_create_ui(visible=False),
104
- dropdown_create_ui(
105
- label=f"Potential candidates by professional responsibilities ({len(config_data.Settings_DROPDOWN_CANDIDATES)})",
106
- info=config_data.InformationMessages_DROPDOWN_CANDIDATES_INFO,
107
- choices=config_data.Settings_DROPDOWN_CANDIDATES,
108
- value=config_data.Settings_DROPDOWN_CANDIDATES[0],
109
- visible=True,
110
- elem_classes="dropdown-container",
111
- ),
112
- number_create_ui(
113
- value=weights_professions[0],
114
- minimum=config_data.Values_0_100[0],
115
- maximum=config_data.Values_0_100[1],
116
- step=1,
117
- label=config_data.Labels_NUMBER_IMPORTANCE_OPE_LABEL,
118
- info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(
119
- config_data.Values_0_100[0], config_data.Values_0_100[1]
120
- ),
121
- show_label=True,
122
- interactive=interactive_professions,
123
- visible=True,
124
- render=True,
125
- elem_classes="number-container",
126
- ),
127
- number_create_ui(
128
- value=weights_professions[1],
129
- minimum=config_data.Values_0_100[0],
130
- maximum=config_data.Values_0_100[1],
131
- step=1,
132
- label=config_data.Labels_NUMBER_IMPORTANCE_CON_LABEL,
133
- info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(
134
- config_data.Values_0_100[0], config_data.Values_0_100[1]
135
- ),
136
- show_label=True,
137
- interactive=interactive_professions,
138
- visible=True,
139
- render=True,
140
- elem_classes="number-container",
141
- ),
142
- number_create_ui(
143
- value=weights_professions[2],
144
- minimum=config_data.Values_0_100[0],
145
- maximum=config_data.Values_0_100[1],
146
- step=1,
147
- label=config_data.Labels_NUMBER_IMPORTANCE_EXT_LABEL,
148
- info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(
149
- config_data.Values_0_100[0], config_data.Values_0_100[1]
150
- ),
151
- show_label=True,
152
- interactive=interactive_professions,
153
- visible=True,
154
- render=True,
155
- elem_classes="number-container",
156
- ),
157
- number_create_ui(
158
- value=weights_professions[3],
159
- minimum=config_data.Values_0_100[0],
160
- maximum=config_data.Values_0_100[1],
161
- step=1,
162
- label=config_data.Labels_NUMBER_IMPORTANCE_AGR_LABEL,
163
- info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(
164
- config_data.Values_0_100[0], config_data.Values_0_100[1]
165
- ),
166
- show_label=True,
167
- interactive=interactive_professions,
168
- visible=True,
169
- render=True,
170
- elem_classes="number-container",
171
- ),
172
- number_create_ui(
173
- value=weights_professions[4],
174
- minimum=config_data.Values_0_100[0],
175
- maximum=config_data.Values_0_100[1],
176
- step=1,
177
- label=config_data.Labels_NUMBER_IMPORTANCE_NNEU_LABEL,
178
- info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(
179
- config_data.Values_0_100[0], config_data.Values_0_100[1]
180
- ),
181
- show_label=True,
182
- interactive=interactive_professions,
183
- visible=True,
184
- render=True,
185
- elem_classes="number-container",
186
- ),
187
  button(
188
  config_data.OtherMessages_CALCULATE_PRACTICAL_TASK,
189
  True,
@@ -204,6 +148,9 @@ def event_handler_calculate_pt_scores_blocks(files, evt_data: gr.EventData):
204
  False,
205
  "csv-container",
206
  ),
 
 
 
207
  video_create_ui(visible=False),
208
  html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
209
  )
 
90
  render=True,
91
  ),
92
  gr.Column(visible=True),
93
+ dropdown_create_ui(
94
+ label=f"Potential candidates by Myers-Briggs Personality Type Indicators ({len(config_data.Settings_DROPDOWN_MBTI)})",
95
+ info=config_data.InformationMessages_DROPDOWN_MBTI_INFO,
96
+ choices=config_data.Settings_DROPDOWN_MBTI,
97
+ value=config_data.Settings_DROPDOWN_MBTI[0],
98
+ visible=True,
99
+ elem_classes="dropdown-container",
100
+ ),
101
+ number_create_ui(
102
+ value=0.5,
103
+ minimum=0.0,
104
+ maximum=1.0,
105
+ step=0.01,
106
+ label=config_data.Labels_THRESHOLD_MBTI_LABEL,
107
+ info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(0, 1.0),
108
+ show_label=True,
109
+ interactive=True,
110
+ visible=True,
111
+ render=True,
112
+ elem_classes="number-container",
113
+ ),
114
  number_create_ui(visible=False),
115
  dropdown_create_ui(visible=False),
116
  number_create_ui(visible=False),
 
122
  number_create_ui(visible=False),
123
  number_create_ui(visible=False),
124
  number_create_ui(visible=False),
125
+ dropdown_create_ui(visible=False),
126
+ number_create_ui(visible=False),
127
+ number_create_ui(visible=False),
128
+ number_create_ui(visible=False),
129
+ number_create_ui(visible=False),
130
+ number_create_ui(visible=False),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  button(
132
  config_data.OtherMessages_CALCULATE_PRACTICAL_TASK,
133
  True,
 
148
  False,
149
  "csv-container",
150
  ),
151
+ gr.Accordion(visible=False),
152
+ gr.HTML(visible=False),
153
+ dataframe(visible=False),
154
  video_create_ui(visible=False),
155
  html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
156
  )
app/event_handlers/clear_blocks.py CHANGED
@@ -76,6 +76,8 @@ def event_handler_clear_blocks():
76
  render=True,
77
  ),
78
  gr.Column(visible=False),
 
 
79
  number_create_ui(visible=False),
80
  dropdown_create_ui(visible=False),
81
  number_create_ui(visible=False),
@@ -106,6 +108,9 @@ def event_handler_clear_blocks():
106
  False,
107
  "csv-container",
108
  ),
 
 
 
109
  video_create_ui(visible=False),
110
  html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
111
  )
 
76
  render=True,
77
  ),
78
  gr.Column(visible=False),
79
+ dropdown_create_ui(visible=False),
80
+ number_create_ui(visible=False),
81
  number_create_ui(visible=False),
82
  dropdown_create_ui(visible=False),
83
  number_create_ui(visible=False),
 
108
  False,
109
  "csv-container",
110
  ),
111
+ gr.Accordion(visible=False),
112
+ gr.HTML(visible=False),
113
+ dataframe(visible=False),
114
  video_create_ui(visible=False),
115
  html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
116
  )
app/event_handlers/event_handlers.py CHANGED
@@ -8,6 +8,7 @@ License: MIT License
8
  import gradio as gr
9
 
10
  # Importing necessary components for the Gradio app
 
11
  from app.event_handlers.files import (
12
  event_handler_files,
13
  event_handler_files_select,
@@ -39,6 +40,8 @@ def setup_app_event_handlers(
39
  practical_tasks,
40
  practical_subtasks,
41
  settings_practical_tasks,
 
 
42
  threshold_professional_skills,
43
  dropdown_professional_skills,
44
  target_score_ope,
@@ -63,10 +66,23 @@ def setup_app_event_handlers(
63
  sorted_videos_column,
64
  practical_task_sorted,
65
  csv_practical_task_sorted,
 
 
 
66
  video_sorted,
67
  in_development,
 
 
 
 
68
  ):
69
  # Events
 
 
 
 
 
 
70
  files.change(
71
  event_handler_files,
72
  [files],
@@ -95,6 +111,8 @@ def setup_app_event_handlers(
95
  practical_subtasks,
96
  practical_subtasks_selected,
97
  settings_practical_tasks,
 
 
98
  threshold_professional_skills,
99
  dropdown_professional_skills,
100
  target_score_ope,
@@ -117,6 +135,9 @@ def setup_app_event_handlers(
117
  sorted_videos_column,
118
  practical_task_sorted,
119
  csv_practical_task_sorted,
 
 
 
120
  video_sorted,
121
  in_development,
122
  ],
@@ -147,6 +168,8 @@ def setup_app_event_handlers(
147
  practical_subtasks,
148
  practical_subtasks_selected,
149
  settings_practical_tasks,
 
 
150
  threshold_professional_skills,
151
  dropdown_professional_skills,
152
  target_score_ope,
@@ -168,6 +191,9 @@ def setup_app_event_handlers(
168
  sorted_videos_column,
169
  practical_task_sorted,
170
  csv_practical_task_sorted,
 
 
 
171
  video_sorted,
172
  in_development,
173
  ],
@@ -185,6 +211,8 @@ def setup_app_event_handlers(
185
  [
186
  practical_subtasks_selected,
187
  settings_practical_tasks,
 
 
188
  threshold_professional_skills,
189
  dropdown_professional_skills,
190
  target_score_ope,
@@ -223,6 +251,8 @@ def setup_app_event_handlers(
223
  files,
224
  practical_subtasks,
225
  pt_scores,
 
 
226
  threshold_professional_skills,
227
  dropdown_professional_skills,
228
  target_score_ope,
@@ -245,6 +275,9 @@ def setup_app_event_handlers(
245
  sorted_videos_column,
246
  practical_task_sorted,
247
  csv_practical_task_sorted,
 
 
 
248
  video_sorted,
249
  in_development,
250
  ],
 
8
  import gradio as gr
9
 
10
  # Importing necessary components for the Gradio app
11
+ from app.event_handlers.languages import event_handler_languages
12
  from app.event_handlers.files import (
13
  event_handler_files,
14
  event_handler_files_select,
 
40
  practical_tasks,
41
  practical_subtasks,
42
  settings_practical_tasks,
43
+ dropdown_mbti,
44
+ threshold_mbti,
45
  threshold_professional_skills,
46
  dropdown_professional_skills,
47
  target_score_ope,
 
66
  sorted_videos_column,
67
  practical_task_sorted,
68
  csv_practical_task_sorted,
69
+ mbti_accordion,
70
+ mbti_description,
71
+ mbti_description_data,
72
  video_sorted,
73
  in_development,
74
+ tab1,
75
+ tab2,
76
+ tab3,
77
+ languages,
78
  ):
79
  # Events
80
+ languages.select(
81
+ fn=event_handler_languages,
82
+ inputs=[languages],
83
+ outputs=[languages, tab1, tab2, tab3],
84
+ queue=True,
85
+ )
86
  files.change(
87
  event_handler_files,
88
  [files],
 
111
  practical_subtasks,
112
  practical_subtasks_selected,
113
  settings_practical_tasks,
114
+ dropdown_mbti,
115
+ threshold_mbti,
116
  threshold_professional_skills,
117
  dropdown_professional_skills,
118
  target_score_ope,
 
135
  sorted_videos_column,
136
  practical_task_sorted,
137
  csv_practical_task_sorted,
138
+ mbti_accordion,
139
+ mbti_description,
140
+ mbti_description_data,
141
  video_sorted,
142
  in_development,
143
  ],
 
168
  practical_subtasks,
169
  practical_subtasks_selected,
170
  settings_practical_tasks,
171
+ dropdown_mbti,
172
+ threshold_mbti,
173
  threshold_professional_skills,
174
  dropdown_professional_skills,
175
  target_score_ope,
 
191
  sorted_videos_column,
192
  practical_task_sorted,
193
  csv_practical_task_sorted,
194
+ mbti_accordion,
195
+ mbti_description,
196
+ mbti_description_data,
197
  video_sorted,
198
  in_development,
199
  ],
 
211
  [
212
  practical_subtasks_selected,
213
  settings_practical_tasks,
214
+ dropdown_mbti,
215
+ threshold_mbti,
216
  threshold_professional_skills,
217
  dropdown_professional_skills,
218
  target_score_ope,
 
251
  files,
252
  practical_subtasks,
253
  pt_scores,
254
+ dropdown_mbti,
255
+ threshold_mbti,
256
  threshold_professional_skills,
257
  dropdown_professional_skills,
258
  target_score_ope,
 
275
  sorted_videos_column,
276
  practical_task_sorted,
277
  csv_practical_task_sorted,
278
+ mbti_accordion,
279
+ mbti_description,
280
+ mbti_description_data,
281
  video_sorted,
282
  in_development,
283
  ],
app/event_handlers/languages.py ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ File: languages.py
3
+ Author: Elena Ryumina and Dmitry Ryumin
4
+ Description: Selected language event handlers for Gradio app.
5
+ License: MIT License
6
+ """
7
+
8
+ import gradio as gr
9
+
10
+ # Importing necessary components for the Gradio app
11
+ from app.config import config_data
12
+ from app.components import dropdown_create_ui
13
+
14
+
15
+ def event_handler_languages(languages):
16
+ if languages.lower() == "english":
17
+ lang_id = 0
18
+ choices = config_data.Settings_LANGUAGES_EN
19
+ elif languages.lower() == "russian":
20
+ lang_id = 1
21
+ choices = config_data.Settings_LANGUAGES_RU
22
+ else:
23
+ lang_id = 0
24
+ choices = config_data.Settings_LANGUAGES_EN
25
+
26
+ return (
27
+ dropdown_create_ui(
28
+ label=None,
29
+ info=None,
30
+ choices=choices,
31
+ value=choices[lang_id],
32
+ visible=True,
33
+ show_label=False,
34
+ elem_classes="dropdown-language-container",
35
+ ),
36
+ gr.Tab(config_data.Labels_APP_LABEL[lang_id]),
37
+ gr.Tab(config_data.Labels_ABOUT_APP_LABEL[lang_id]),
38
+ gr.Tab(config_data.Labels_ABOUT_AUTHORS_LABEL[lang_id]),
39
+ )
app/event_handlers/practical_subtasks.py CHANGED
@@ -18,7 +18,50 @@ def event_handler_practical_subtasks(
18
  ):
19
  practical_subtasks_selected[practical_tasks] = practical_subtasks
20
 
21
- if practical_subtasks.lower() == "professional groups":
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  df_traits_priority_for_professions = read_csv_file(
23
  config_data.Links_PROFESSIONS
24
  )
@@ -30,6 +73,8 @@ def event_handler_practical_subtasks(
30
  return (
31
  practical_subtasks_selected,
32
  gr.Column(visible=True),
 
 
33
  number_create_ui(visible=False),
34
  dropdown_create_ui(visible=False),
35
  number_create_ui(visible=False),
@@ -129,6 +174,8 @@ def event_handler_practical_subtasks(
129
  return (
130
  practical_subtasks_selected,
131
  gr.Column(visible=True),
 
 
132
  number_create_ui(
133
  value=0.5,
134
  minimum=0.0,
@@ -173,6 +220,8 @@ def event_handler_practical_subtasks(
173
  return (
174
  practical_subtasks_selected,
175
  gr.Column(visible=True),
 
 
176
  number_create_ui(visible=False),
177
  dropdown_create_ui(visible=False),
178
  number_create_ui(
@@ -266,6 +315,7 @@ def event_handler_practical_subtasks(
266
  elif (
267
  practical_subtasks.lower() == "car characteristics"
268
  or practical_subtasks.lower() == "mobile device application categories"
 
269
  ):
270
  df_correlation_coefficients = read_csv_file(
271
  config_data.Links_CAR_CHARACTERISTICS,
@@ -275,6 +325,8 @@ def event_handler_practical_subtasks(
275
  return (
276
  practical_subtasks_selected,
277
  gr.Column(visible=True),
 
 
278
  number_create_ui(visible=False),
279
  dropdown_create_ui(visible=False),
280
  number_create_ui(visible=False),
@@ -284,7 +336,7 @@ def event_handler_practical_subtasks(
284
  number_create_ui(visible=False),
285
  number_create_ui(visible=False),
286
  number_create_ui(
287
- value=3,
288
  minimum=1,
289
  maximum=df_correlation_coefficients.columns.size,
290
  step=1,
@@ -299,7 +351,7 @@ def event_handler_practical_subtasks(
299
  elem_classes="number-container",
300
  ),
301
  number_create_ui(
302
- value=3,
303
  minimum=1,
304
  maximum=5,
305
  step=1,
@@ -335,6 +387,8 @@ def event_handler_practical_subtasks(
335
  return (
336
  practical_subtasks_selected,
337
  gr.Column(visible=False),
 
 
338
  number_create_ui(visible=False),
339
  dropdown_create_ui(visible=False),
340
  number_create_ui(visible=False),
 
18
  ):
19
  practical_subtasks_selected[practical_tasks] = practical_subtasks
20
 
21
+ if practical_subtasks.lower() == "sixteen myers-briggs personality type indicators":
22
+ return (
23
+ practical_subtasks_selected,
24
+ gr.Column(visible=True),
25
+ dropdown_create_ui(
26
+ label=f"Potential candidates by Myers-Briggs Personality Type Indicators ({len(config_data.Settings_DROPDOWN_MBTI)})",
27
+ info=config_data.InformationMessages_DROPDOWN_MBTI_INFO,
28
+ choices=config_data.Settings_DROPDOWN_MBTI,
29
+ value=config_data.Settings_DROPDOWN_MBTI[0],
30
+ visible=True,
31
+ elem_classes="dropdown-container",
32
+ ),
33
+ number_create_ui(
34
+ value=0.5,
35
+ minimum=0.0,
36
+ maximum=1.0,
37
+ step=0.01,
38
+ label=config_data.Labels_THRESHOLD_MBTI_LABEL,
39
+ info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(0, 1.0),
40
+ show_label=True,
41
+ interactive=True,
42
+ visible=True,
43
+ render=True,
44
+ elem_classes="number-container",
45
+ ),
46
+ number_create_ui(visible=False),
47
+ dropdown_create_ui(visible=False),
48
+ number_create_ui(visible=False),
49
+ number_create_ui(visible=False),
50
+ number_create_ui(visible=False),
51
+ number_create_ui(visible=False),
52
+ number_create_ui(visible=False),
53
+ number_create_ui(visible=False),
54
+ number_create_ui(visible=False),
55
+ number_create_ui(visible=False),
56
+ number_create_ui(visible=False),
57
+ dropdown_create_ui(visible=False),
58
+ number_create_ui(visible=False),
59
+ number_create_ui(visible=False),
60
+ number_create_ui(visible=False),
61
+ number_create_ui(visible=False),
62
+ number_create_ui(visible=False),
63
+ )
64
+ elif practical_subtasks.lower() == "professional groups":
65
  df_traits_priority_for_professions = read_csv_file(
66
  config_data.Links_PROFESSIONS
67
  )
 
73
  return (
74
  practical_subtasks_selected,
75
  gr.Column(visible=True),
76
+ dropdown_create_ui(visible=False),
77
+ number_create_ui(visible=False),
78
  number_create_ui(visible=False),
79
  dropdown_create_ui(visible=False),
80
  number_create_ui(visible=False),
 
174
  return (
175
  practical_subtasks_selected,
176
  gr.Column(visible=True),
177
+ dropdown_create_ui(visible=False),
178
+ number_create_ui(visible=False),
179
  number_create_ui(
180
  value=0.5,
181
  minimum=0.0,
 
220
  return (
221
  practical_subtasks_selected,
222
  gr.Column(visible=True),
223
+ dropdown_create_ui(visible=False),
224
+ number_create_ui(visible=False),
225
  number_create_ui(visible=False),
226
  dropdown_create_ui(visible=False),
227
  number_create_ui(
 
315
  elif (
316
  practical_subtasks.lower() == "car characteristics"
317
  or practical_subtasks.lower() == "mobile device application categories"
318
+ or practical_subtasks.lower() == "clothing style correlation"
319
  ):
320
  df_correlation_coefficients = read_csv_file(
321
  config_data.Links_CAR_CHARACTERISTICS,
 
325
  return (
326
  practical_subtasks_selected,
327
  gr.Column(visible=True),
328
+ dropdown_create_ui(visible=False),
329
+ number_create_ui(visible=False),
330
  number_create_ui(visible=False),
331
  dropdown_create_ui(visible=False),
332
  number_create_ui(visible=False),
 
336
  number_create_ui(visible=False),
337
  number_create_ui(visible=False),
338
  number_create_ui(
339
+ value=1,
340
  minimum=1,
341
  maximum=df_correlation_coefficients.columns.size,
342
  step=1,
 
351
  elem_classes="number-container",
352
  ),
353
  number_create_ui(
354
+ value=1,
355
  minimum=1,
356
  maximum=5,
357
  step=1,
 
387
  return (
388
  practical_subtasks_selected,
389
  gr.Column(visible=False),
390
+ dropdown_create_ui(visible=False),
391
+ number_create_ui(visible=False),
392
  number_create_ui(visible=False),
393
  dropdown_create_ui(visible=False),
394
  number_create_ui(visible=False),
app/mbti_description.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ File: mbti_description.py
3
+ Author: Elena Ryumina and Dmitry Ryumin
4
+ Description: Personality dimensions description.
5
+ License: MIT License
6
+ """
7
+
8
+ import pandas as pd
9
+
10
+ # Importing necessary components for the Gradio app
11
+
12
+ MBTI_DATA = pd.DataFrame(
13
+ {
14
+ "Dimension description": [
15
+ "How we interact with the world and where we direct our energy",
16
+ "The kind of information we naturally notice",
17
+ "How we make decisions",
18
+ "Whether we prefer to live in a more structured way (making decisions) or in a more spontaneous way (taking in information)",
19
+ ],
20
+ "Dimension": [
21
+ "(E) Extraversion - Introversion (I)",
22
+ "(S) Sensing - Intuition (N)",
23
+ "(T) Thinking - Feeling (F)",
24
+ "(J) Judging - Perceiving (P)",
25
+ ],
26
+ }
27
+ )
28
+
29
+ MBTI_DESCRIPTION = "<h4>The four human Personality Dimensions</h4>"
app/tabs.py CHANGED
@@ -10,6 +10,7 @@ import gradio as gr
10
  # Importing necessary components for the Gradio app
11
  from app.description import DESCRIPTION
12
  from app.description_steps import STEP_1, STEP_2
 
13
  from app.app import APP
14
  from app.authors import AUTHORS
15
  from app.config import config_data
@@ -96,6 +97,29 @@ def app_tab():
96
  variant="default",
97
  elem_classes="settings-container",
98
  ) as settings_practical_tasks:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  threshold_professional_skills = number_create_ui(
100
  value=0.5,
101
  minimum=0.0,
@@ -209,7 +233,7 @@ def app_tab():
209
  )
210
 
211
  number_priority = number_create_ui(
212
- value=3,
213
  minimum=1,
214
  maximum=df_correlation_coefficients.columns.size,
215
  step=1,
@@ -225,7 +249,7 @@ def app_tab():
225
  )
226
 
227
  number_importance_traits = number_create_ui(
228
- value=3,
229
  minimum=1,
230
  maximum=5,
231
  step=1,
@@ -365,6 +389,20 @@ def app_tab():
365
  with gr.Column(scale=1, visible=False, render=True) as sorted_videos_column:
366
  practical_task_sorted = dataframe(visible=False)
367
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
368
  csv_practical_task_sorted = files_create_ui(
369
  None,
370
  "single",
@@ -376,7 +414,9 @@ def app_tab():
376
  "csv-container",
377
  )
378
 
379
- video_sorted = video_create_ui(visible=False)
 
 
380
 
381
  practical_subtasks_selected = gr.JSON(
382
  value={
@@ -404,6 +444,8 @@ def app_tab():
404
  practical_tasks,
405
  practical_subtasks,
406
  settings_practical_tasks,
 
 
407
  threshold_professional_skills,
408
  dropdown_professional_skills,
409
  target_score_ope,
@@ -428,6 +470,9 @@ def app_tab():
428
  sorted_videos_column,
429
  practical_task_sorted,
430
  csv_practical_task_sorted,
 
 
 
431
  video_sorted,
432
  in_development,
433
  )
 
10
  # Importing necessary components for the Gradio app
11
  from app.description import DESCRIPTION
12
  from app.description_steps import STEP_1, STEP_2
13
+ from app.mbti_description import MBTI_DESCRIPTION, MBTI_DATA
14
  from app.app import APP
15
  from app.authors import AUTHORS
16
  from app.config import config_data
 
97
  variant="default",
98
  elem_classes="settings-container",
99
  ) as settings_practical_tasks:
100
+ dropdown_mbti = dropdown_create_ui(
101
+ label=f"Potential candidates by Myers-Briggs Personality Type Indicators ({len(config_data.Settings_DROPDOWN_MBTI)})",
102
+ info=config_data.InformationMessages_DROPDOWN_MBTI_INFO,
103
+ choices=config_data.Settings_DROPDOWN_MBTI,
104
+ value=config_data.Settings_DROPDOWN_MBTI[0],
105
+ visible=False,
106
+ elem_classes="dropdown-container",
107
+ )
108
+
109
+ threshold_mbti = number_create_ui(
110
+ value=0.5,
111
+ minimum=0.0,
112
+ maximum=1.0,
113
+ step=0.01,
114
+ label=config_data.Labels_THRESHOLD_MBTI_LABEL,
115
+ info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(0, 1.0),
116
+ show_label=True,
117
+ interactive=True,
118
+ visible=False,
119
+ render=True,
120
+ elem_classes="number-container",
121
+ )
122
+
123
  threshold_professional_skills = number_create_ui(
124
  value=0.5,
125
  minimum=0.0,
 
233
  )
234
 
235
  number_priority = number_create_ui(
236
+ value=1,
237
  minimum=1,
238
  maximum=df_correlation_coefficients.columns.size,
239
  step=1,
 
249
  )
250
 
251
  number_importance_traits = number_create_ui(
252
+ value=1,
253
  minimum=1,
254
  maximum=5,
255
  step=1,
 
389
  with gr.Column(scale=1, visible=False, render=True) as sorted_videos_column:
390
  practical_task_sorted = dataframe(visible=False)
391
 
392
+ with gr.Accordion(
393
+ label=config_data.Labels_NOTE_MBTI_LABEL,
394
+ open=False,
395
+ visible=False,
396
+ ) as mbti_accordion:
397
+ mbti_description = gr.HTML(value=MBTI_DESCRIPTION, visible=False)
398
+
399
+ mbti_description_data = dataframe(
400
+ headers=MBTI_DATA.columns.tolist(),
401
+ values=MBTI_DATA.values.tolist(),
402
+ visible=False,
403
+ elem_classes="mbti-dataframe",
404
+ )
405
+
406
  csv_practical_task_sorted = files_create_ui(
407
  None,
408
  "single",
 
414
  "csv-container",
415
  )
416
 
417
+ video_sorted = video_create_ui(
418
+ visible=False, elem_classes="video-sorted-container"
419
+ )
420
 
421
  practical_subtasks_selected = gr.JSON(
422
  value={
 
444
  practical_tasks,
445
  practical_subtasks,
446
  settings_practical_tasks,
447
+ dropdown_mbti,
448
+ threshold_mbti,
449
  threshold_professional_skills,
450
  dropdown_professional_skills,
451
  target_score_ope,
 
470
  sorted_videos_column,
471
  practical_task_sorted,
472
  csv_practical_task_sorted,
473
+ mbti_accordion,
474
+ mbti_description,
475
+ mbti_description_data,
476
  video_sorted,
477
  in_development,
478
  )
config.toml CHANGED
@@ -1,5 +1,5 @@
1
  [AppSettings]
2
- APP_VERSION = "0.7.0"
3
  CSS_PATH = "app.css"
4
 
5
  [InformationMessages]
@@ -7,9 +7,11 @@ NOTI_VIDEOS = "Select the video(s)"
7
  PRACTICAL_TASKS_INFO = "Choose a practical task"
8
  PRACTICAL_SUBTASKS_INFO = "Choose a practical subtask"
9
  NOTI_IN_DEV = "In development"
 
10
  DROPDOWN_PROFESSIONAL_SKILLS_INFO = "What professional skill are you interested in?"
11
  DROPDOWN_DROPDOWN_COLLEAGUES_INFO = "What colleague are you interested in?"
12
  DROPDOWN_CANDIDATES_INFO = "What profession are you interested in?"
 
13
  VALUE_FROM_TO_INFO = "Set value from {} to {}"
14
  SUM_WEIGHTS = "The sum of the weights of the personality traits should be 100, not {}"
15
  STEP_1 = "Step 1: Calculation of personality traits scores"
@@ -25,11 +27,16 @@ EXPORT_PG = "Export ranking professional groups results to a CSV file"
25
  EXPORT_PS = "Export ranking professional skill results to a CSV file"
26
  EXPORT_WT = "Export ranking effective work teams results to a CSV file"
27
  EXPORT_CP = "Export consumer preferences for industrial goods results to a CSV file"
 
28
  NOTI_CALCULATE = "You can calculate Big Five personality traits scores"
29
 
30
  [Labels]
 
 
 
31
  PRACTICAL_TASKS_LABEL = "Practical tasks"
32
  PRACTICAL_SUBTASKS_LABEL = "Practical subtasks"
 
33
  THRESHOLD_PROFESSIONAL_SKILLS_LABEL = "Polarity traits threshold"
34
  TARGET_SCORE_OPE_LABEL = "Openness target score"
35
  TARGET_SCORE_CON_LABEL = "Conscientiousness target score"
@@ -45,6 +52,8 @@ NUMBER_IMPORTANCE_EXT_LABEL = "Extraversion weight"
45
  NUMBER_IMPORTANCE_AGR_LABEL = "Agreeableness weight"
46
  NUMBER_IMPORTANCE_NNEU_LABEL = "Non-Neuroticism weight"
47
  THRESHOLD_CONSUMER_PREFERENCES_LABEL = "Polarity traits threshold"
 
 
48
 
49
  [TabCreators]
50
  "App" = "app_tab"
@@ -58,12 +67,34 @@ COLLEAGUE_RANKING = "_colleague_ranking.csv"
58
  CAR_CHARACTERISTICS = "auto_characteristics_priorities.csv"
59
  MDA_CATEGORIES = "divice_characteristics_priorities.csv"
60
  POTENTIAL_CANDIDATES = "potential_candidates.csv"
 
61
 
62
  [Settings]
 
 
63
  SHORT_PROFESSIONAL_SKILLS = ["OPE", "CON", "EXT", "AGR", "NNEU"]
64
  DROPDOWN_PROFESSIONAL_SKILLS = ["Analytical", "Interactive", "Routine", "Non-Routine"]
65
  DROPDOWN_COLLEAGUES = ["major", "minor"]
66
  DROPDOWN_CANDIDATES = ["Managers/executives", "Entrepreneurship", "Social/Non profit making professions", "Public sector professions", "Scientists/researchers, and engineers", "Custom"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
  [Values]
69
  TARGET_SCORES = [0.527886, 0.522337, 0.458468, 0.51761, 0.444649]
@@ -74,4 +105,6 @@ PROFESSIONAL_SKILLS = "https://download.sberdisk.ru/download/file/478678231?toke
74
  FINDING_COLLEAGUE = "https://download.sberdisk.ru/download/file/478675819?token=LuB7L1QsEY0UuSs&filename=colleague_ranking.csv"
75
  CAR_CHARACTERISTICS = "https://download.sberdisk.ru/download/file/478675818?token=EjfLMqOeK8cfnOu&filename=auto_characteristics.csv"
76
  MDA_CATEGORIES = "https://download.sberdisk.ru/download/file/478676690?token=7KcAxPqMpWiYQnx&filename=divice_characteristics.csv"
77
- PROFESSIONS = "https://download.sberdisk.ru/download/file/478675798?token=fF5fNZVpthQlEV0&filename=traits_priority_for_professions.csv"
 
 
 
1
  [AppSettings]
2
+ APP_VERSION = "0.8.0"
3
  CSS_PATH = "app.css"
4
 
5
  [InformationMessages]
 
7
  PRACTICAL_TASKS_INFO = "Choose a practical task"
8
  PRACTICAL_SUBTASKS_INFO = "Choose a practical subtask"
9
  NOTI_IN_DEV = "In development"
10
+ DROPDOWN_MBTI_INFO = "What personality type indicator are you interested in?"
11
  DROPDOWN_PROFESSIONAL_SKILLS_INFO = "What professional skill are you interested in?"
12
  DROPDOWN_DROPDOWN_COLLEAGUES_INFO = "What colleague are you interested in?"
13
  DROPDOWN_CANDIDATES_INFO = "What profession are you interested in?"
14
+ DROPDOWN_LANGUAGES_INFO = "Select the language of the app"
15
  VALUE_FROM_TO_INFO = "Set value from {} to {}"
16
  SUM_WEIGHTS = "The sum of the weights of the personality traits should be 100, not {}"
17
  STEP_1 = "Step 1: Calculation of personality traits scores"
 
27
  EXPORT_PS = "Export ranking professional skill results to a CSV file"
28
  EXPORT_WT = "Export ranking effective work teams results to a CSV file"
29
  EXPORT_CP = "Export consumer preferences for industrial goods results to a CSV file"
30
+ EXPORT_MBTI = "Export ranking personality type results to a CSV file"
31
  NOTI_CALCULATE = "You can calculate Big Five personality traits scores"
32
 
33
  [Labels]
34
+ APP_LABEL = ["App", "Приложение"]
35
+ ABOUT_APP_LABEL = ["About the App", "О приложении"]
36
+ ABOUT_AUTHORS_LABEL = ["About the Authors", "Об авторах"]
37
  PRACTICAL_TASKS_LABEL = "Practical tasks"
38
  PRACTICAL_SUBTASKS_LABEL = "Practical subtasks"
39
+ THRESHOLD_MBTI_LABEL = "Personality type indicator threshold"
40
  THRESHOLD_PROFESSIONAL_SKILLS_LABEL = "Polarity traits threshold"
41
  TARGET_SCORE_OPE_LABEL = "Openness target score"
42
  TARGET_SCORE_CON_LABEL = "Conscientiousness target score"
 
52
  NUMBER_IMPORTANCE_AGR_LABEL = "Agreeableness weight"
53
  NUMBER_IMPORTANCE_NNEU_LABEL = "Non-Neuroticism weight"
54
  THRESHOLD_CONSUMER_PREFERENCES_LABEL = "Polarity traits threshold"
55
+ LANGUAGES_LABEL = "Languages"
56
+ NOTE_MBTI_LABEL = "Note: What is MBTI?"
57
 
58
  [TabCreators]
59
  "App" = "app_tab"
 
67
  CAR_CHARACTERISTICS = "auto_characteristics_priorities.csv"
68
  MDA_CATEGORIES = "divice_characteristics_priorities.csv"
69
  POTENTIAL_CANDIDATES = "potential_candidates.csv"
70
+ MBTI_JOB = "mbti_job_match.csv"
71
 
72
  [Settings]
73
+ LANGUAGES_EN = ["English", "Russian"]
74
+ LANGUAGES_RU = ["Английский", "Русский"]
75
  SHORT_PROFESSIONAL_SKILLS = ["OPE", "CON", "EXT", "AGR", "NNEU"]
76
  DROPDOWN_PROFESSIONAL_SKILLS = ["Analytical", "Interactive", "Routine", "Non-Routine"]
77
  DROPDOWN_COLLEAGUES = ["major", "minor"]
78
  DROPDOWN_CANDIDATES = ["Managers/executives", "Entrepreneurship", "Social/Non profit making professions", "Public sector professions", "Scientists/researchers, and engineers", "Custom"]
79
+ DROPDOWN_MBTI = [
80
+ "The Inspector (ISTJ): Accountant, Auditor, Budget Analyst, Financial Manager, Developer, Systems Analyst, Librarian etc.",
81
+ "The Protector (ISFJ): Nurse, Doctor, Veterinarian or Veterinary Nurse/Assistant, Social Worker, Agricultural or Food Scientist, Secretary, Driver, etc.",
82
+ "The Counselor (INFJ): Psychologist, Human Resources Professional, Office Manager, Training Specialist, Graphic Designer, etc.",
83
+ "The Mastermind (INTJ): Animator, Architect, Content Writer, Photographer, TV Journalist, Video Editor, Business Development, Executive, Professor, etc.",
84
+ "The Crafter (ISTP): Engineer, Technician, Construction Worker, Inspector, Forensic Scientist, Software Engineer, Computer Programmer, etc.",
85
+ "The Composer (ISFP): Marketing Assistant, Dancer, Chef, Office Administrator, Artist, Interior Designer, Legal Secretary, Nurse, etc.",
86
+ "The Healer (INFP): Writer, Multimedia Designer, Customer Relations Manager, Special Education Teacher, Coach, Editor, Fashion Designer, etc.",
87
+ "The Architect (INTP): Technical Writer, Web Developer, Information Security Analyst, Researcher, Scientist, Lawyer, etc.",
88
+ "The Promoter (ESTP): Customer Care Specialist, Actor, Personal Trainer, Brand Ambassador, Manager, Entrepreneur, Creative Director, Police Officer, Marketing Officer, Manufacturer, etc.",
89
+ "The Performer (ESFP): Flight Attendant, Entertainer, Teacher, Public Relations Manager, Sales Representative, Event Planner, etc.",
90
+ "The Champion (ENFP): Healthcare Professional, Producer, Retail Sales Associate, Customer Service; Screenwriter; TV/Radio Host, etc.",
91
+ "The Visionary (ENTP): Engineer, Market Researcher, Social Media Manager, Management Analyst, Digital Marketing Executive, Business Consultant, Game Designer/Developer, Sales Manager, etc.",
92
+ "The Supervisor (ESTJ): Managing Director, Hotel Manager, Finance Officer, Judge, Real Estate Agent, Chief Executive Officer, Chef, Business Development Manager, Telemarketer, etc.",
93
+ "The Provider (ESFJ): Technical Support Specialist, Account Manager, College Professor, Medical Researcher, Bookkeeper, Photojournalist, etc.",
94
+ "The Teacher (ENFJ): Public Relations Manager, Sales Manager, Human Resource Director, Art Director, Counselor, etc.",
95
+ "The Commander (ENTJ): Construction Supervisor, Health Services Administrator, Financial Accountant, Auditor, Lawyer, School Principal, Chemical Engineer, Database Manager, etc.",
96
+ ]
97
+ DROPDOWN_MBTI_DEL_COLS = ["EI", "SN", "TF", "JP", "Match"]
98
 
99
  [Values]
100
  TARGET_SCORES = [0.527886, 0.522337, 0.458468, 0.51761, 0.444649]
 
105
  FINDING_COLLEAGUE = "https://download.sberdisk.ru/download/file/478675819?token=LuB7L1QsEY0UuSs&filename=colleague_ranking.csv"
106
  CAR_CHARACTERISTICS = "https://download.sberdisk.ru/download/file/478675818?token=EjfLMqOeK8cfnOu&filename=auto_characteristics.csv"
107
  MDA_CATEGORIES = "https://download.sberdisk.ru/download/file/478676690?token=7KcAxPqMpWiYQnx&filename=divice_characteristics.csv"
108
+ CLOTHING_SC = "https://download.sberdisk.ru/download/file/493644097?token=KGtSGMxjZtWXmBz&filename=df_%D1%81lothing_style_correlation.csv"
109
+ PROFESSIONS = "https://download.sberdisk.ru/download/file/478675798?token=fF5fNZVpthQlEV0&filename=traits_priority_for_professions.csv"
110
+ MBTI = "https://download.sberdisk.ru/download/file/493644095?token=EX7hFxNJhMoLumI&filename=df_mbti_correlation.csv"
images/AA.jpg ADDED
practical_tasks.yaml CHANGED
@@ -1,5 +1,6 @@
1
  - task: "Ranking potential candidates by professional responsibilities"
2
  subtasks:
 
3
  - "Professional groups"
4
  - "Professional skills"
5
  - task: "Forming effective work teams"
@@ -9,4 +10,5 @@
9
  - task: "Predicting consumer preferences for industrial goods"
10
  subtasks:
11
  - "Car characteristics"
12
- - "Mobile device application categories"
 
 
1
  - task: "Ranking potential candidates by professional responsibilities"
2
  subtasks:
3
+ - "Sixteen Myers-Briggs Personality Type Indicators"
4
  - "Professional groups"
5
  - "Professional skills"
6
  - task: "Forming effective work teams"
 
10
  - task: "Predicting consumer preferences for industrial goods"
11
  subtasks:
12
  - "Car characteristics"
13
+ - "Mobile device application categories"
14
+ - "Clothing style correlation"
requirements.txt CHANGED
@@ -2,6 +2,6 @@ gradio==4.23.0
2
  requests==2.31.0
3
  PyYAML==6.0.1
4
  toml==0.10.2
5
- oceanai==1.0.0a27
6
  tf-keras==2.16.0
7
  pandas==2.2.1
 
2
  requests==2.31.0
3
  PyYAML==6.0.1
4
  toml==0.10.2
5
+ oceanai==1.0.0a28
6
  tf-keras==2.16.0
7
  pandas==2.2.1