Skip to content

Commit

Permalink
Summary
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryRyumin committed Mar 28, 2024
1 parent d055660 commit 9945c8c
Show file tree
Hide file tree
Showing 5 changed files with 394 additions and 398 deletions.
3 changes: 1 addition & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ librosa>=0.9.2
audioread>=3.0.0
scikit-learn>=1.1.3
opencv-contrib-python>=4.6.0.66
pymediainfo>=6.0.1
mediapipe>=0.9.0
pytest>=7.4.3
liwc>=0.5.0
Expand All @@ -29,4 +28,4 @@ torch == 2.0.1
torchaudio == 2.0.2
oceanai>=1.0.0a20
sacremoses>=0.0.1
gradio>=4.23.0
gradio>=4.24.0
2 changes: 1 addition & 1 deletion oceanai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
__uri__ = "https://github.com/DmitryRyumin/oceanai"

__version__ = "1.0"
__release__ = __version__ + ".0a21"
__release__ = __version__ + ".0a22"

__author__ru__ = "Рюмина Елена, Рюмин Дмитрий, Карпов Алексей"
__author__en__ = "Elena Ryumina, Dmitry Ryumin, Alexey Karpov"
Expand Down
39 changes: 23 additions & 16 deletions oceanai/modules/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import mediapipe as mp # Набор нейросетевых моделей и решений для компьютерного зрения
import IPython
import logging
import pymediainfo # Получение meta данных из медиафайлов
import urllib.error # Обработка ошибок URL
import math
import liwc # Анализатор лингвистических запросов и подсчета слов
Expand Down Expand Up @@ -353,8 +352,12 @@ def __post_init__(self):

# Верные предсказания для подсчета точности
self._true_traits: Dict[str, str] = {
"fi": {"sberdisk": "https://download.sberdisk.ru/download/file/478675810?token=anU8umMha1GiWPQ&filename=data_true_traits_fi.csv"},
"mupta": {"sberdisk": "https://download.sberdisk.ru/download/file/478675811?token=hUMsrUSKjSRrV5e&filename=data_true_traits_mupta.csv"}
"fi": {
"sberdisk": "https://download.sberdisk.ru/download/file/478675810?token=anU8umMha1GiWPQ&filename=data_true_traits_fi.csv"
},
"mupta": {
"sberdisk": "https://download.sberdisk.ru/download/file/478675811?token=hUMsrUSKjSRrV5e&filename=data_true_traits_mupta.csv"
},
}

self._df_files: pd.DataFrame = pd.DataFrame() # DataFrame с данными
Expand Down Expand Up @@ -612,7 +615,6 @@ def df_pkgs_(self) -> pd.DataFrame:
| 10 | Librosa | 0.9.2 |
| 11 | AudioRead | 3.0.0 |
| 12 | IPython | 8.7.0 |
| 13 | PyMediaInfo | 6.0.1 |
| 14 | Requests | 2.28.1 |
| 15 | JupyterLab | 3.5.0 |
|----|--------------|---------|
Expand Down Expand Up @@ -3572,7 +3574,7 @@ def _priority_calculation(
return self._df_files_priority
else:
try:

self._df_files_priority = self._df_files.copy()
df_files_priority = self._df_files.copy()

Expand Down Expand Up @@ -3711,7 +3713,7 @@ def _colleague_ranking(
return self._df_files_colleague
else:
return self._df_files_colleague

def _priority_skill_calculation(
self,
correlation_coefficients: Optional[pd.DataFrame] = None,
Expand Down Expand Up @@ -3761,24 +3763,32 @@ def _priority_skill_calculation(
try:
self._df_files_priority_skill = self._df_files.copy()
skills_name = correlation_coefficients.columns[2:].tolist()
score_level=['high', 'low']
score_level = ["high", "low"]
traits = self.keys_dataset_[1:]
pred_list = self._df_files_priority_skill[traits].values.tolist()
new_list = []

for index_person, curr_scores in enumerate(pred_list):
result = np.zeros((len(traits),len(skills_name)))
result = np.zeros((len(traits), len(skills_name)))

for index_traits, score in enumerate(curr_scores):
trait = traits[index_traits]
category = score_level[0] if score >= threshold else score_level[1]
coefficient = correlation_coefficients[correlation_coefficients.Trait==trait].values[score_level.index(category)][2:]
result[index_traits] = score*coefficient
coefficient = correlation_coefficients[correlation_coefficients.Trait == trait].values[
score_level.index(category)
][2:]
result[index_traits] = score * coefficient

new_list.append(np.hstack((self._df_files_priority_skill.iloc[index_person], np.mean(result, axis=0))))
new_list.append(
np.hstack((self._df_files_priority_skill.iloc[index_person], np.mean(result, axis=0)))
)

self._df_files_priority_skill = pd.DataFrame(data=new_list,columns=self.keys_dataset_+skills_name)
self._df_files_priority_skill = self._df_files_priority_skill.sort_values(by=skills_name, ascending=False)
self._df_files_priority_skill = pd.DataFrame(
data=new_list, columns=self.keys_dataset_ + skills_name
)
self._df_files_priority_skill = self._df_files_priority_skill.sort_values(
by=skills_name, ascending=False
)
self._df_files_priority_skill.index.name = self._keys_id
self._df_files_priority_skill.index += 1
self._df_files_priority_skill.index = self._df_files_priority_skill.index.map(str)
Expand Down Expand Up @@ -3873,7 +3883,6 @@ def libs_vers(self, out: bool = True, runtime: bool = True, run: bool = True) ->
| 10 | Librosa | 0.9.2 |
| 11 | AudioRead | 3.0.0 |
| 12 | IPython | 8.7.0 |
| 13 | PyMediaInfo | 6.0.1 |
| 14 | Requests | 2.28.1 |
| 15 | JupyterLab | 3.5.0 |
| 16 | LIWC | 0.5.0 |
Expand Down Expand Up @@ -3956,7 +3965,6 @@ def libs_vers(self, out: bool = True, runtime: bool = True, run: bool = True) ->
"Librosa",
"AudioRead",
"IPython",
"PyMediaInfo",
"Requests",
"JupyterLab",
"LIWC",
Expand All @@ -3980,7 +3988,6 @@ def libs_vers(self, out: bool = True, runtime: bool = True, run: bool = True) ->
librosa,
audioread,
IPython,
pymediainfo,
requests,
jlab,
liwc,
Expand Down
Loading

0 comments on commit 9945c8c

Please sign in to comment.