-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from Sandrro/dev
Dev
- Loading branch information
Showing
16 changed files
with
145 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,10 @@ name: Tests | |
on: | ||
push: | ||
branches: | ||
- dev | ||
- "*" | ||
pull_request: | ||
branches: | ||
- dev | ||
- master | ||
|
||
jobs: | ||
test: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# SLOYKA | ||
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) | ||
[![Documentation Status](https://readthedocs.org/projects/soika/badge/?version=latest)](https://soika.readthedocs.io/en/latest/?badge=latest) | ||
[![Documentation Status](https://readthedocs.org/projects/sloyka/badge/?version=latest)](https://sloyka.readthedocs.io/ru/latest/?badge=latest) | ||
[![PythonVersion](https://img.shields.io/badge/python-3.11-blue)](https://pypi.org/project/scikit-learn/) | ||
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) | ||
[![Tests](https://github.com/GeorgeKontsevik/sloyka/.github/workflows/2dev_ci_on_pr.yaml/badge.svg?branch=dev)](https://github.com/GeorgeKontsevik/sloyka/.github/workflows/2dev_ci_on_pr.yaml) | ||
[![Tests](https://github.com/GeorgeKontsevik/sloyka/actions/workflows/2dev_ci_on_pr.yaml/badge.svg?branch=dev)](https://github.com/GeorgeKontsevik/sloyka/actions/workflows/2dev_ci_on_pr.yaml) | ||
|
||
[![sloyka_community_chat](https://img.shields.io/badge/-community-blue?logo=telegram)](https://t.me/sloyka_community) | ||
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1wCUJAqlq9GMKw1wpTsWrzYwr10pWDeHv?usp=sharing) | ||
|
@@ -38,5 +38,15 @@ [email protected] (Александр Антонов, Project Lead) | |
[email protected] (just in case). | ||
|
||
## Цитирование | ||
Antonov, A., Gornova, G., Kontsevik, G., Turkov, L., Vorona, V., & Mityagin, S. (2024, July). Transformation of Local Communities from Neighborhoods to Urban Commons in the Production of Social Representations of Space. In International Conference on Computational Science and Its Applications (pp. 436-447). Cham: Springer Nature Switzerland. | ||
|
||
``` bibtex | ||
@inproceedings{antonov2024transformation, | ||
title={Transformation of Local Communities from Neighborhoods to Urban Commons in the Production of Social Representations of Space}, | ||
author={Antonov, Aleksandr and Gornova, Galina and Kontsevik, Georgii and Turkov, Leonid and Vorona, Vladimir and Mityagin, Sergey}, | ||
booktitle={International Conference on Computational Science and Its Applications}, | ||
pages={436--447}, | ||
year={2024}, | ||
organization={Springer} | ||
} | ||
``` | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,24 @@ | ||
# import pytest | ||
# import torch | ||
# import pandas as pd | ||
# from sloyka import TextClassifiers | ||
import pytest | ||
import torch | ||
import pandas as pd | ||
from sloyka import TextClassifiers | ||
|
||
# path_to_file = "sloyka/sample_data/raw/Адмиралтейский.csv" | ||
@pytest.fixture | ||
def sample_dataframe(): | ||
s_data = {'Текст комментария': {203: 'На Чайковского 63 тоже идет кап.ремонт. В квартире у пенсионеров побили стекла. Куда им обратиться?', | ||
204: 'Вся улица Жуковского и Восстания заклеена рекламой! Почему не действует полиция и администрация с ЖСК-1 ?'}, | ||
'message_id': {203: 195, 204: 196}} | ||
return pd.DataFrame(s_data) | ||
|
||
# @pytest.fixture | ||
# def test_data(): | ||
# df_predict = pd.read_csv(path_to_file, sep=";") | ||
# df_predict.rename(columns={"Текст комментария": "Текст"}, inplace=True) | ||
# df_predict = df_predict.dropna(subset=["Текст"]) | ||
# df_predict = df_predict.head(3) | ||
# return df_predict | ||
@pytest.fixture | ||
def model(): | ||
return TextClassifiers( | ||
repository_id="Sandrro/text_to_function_v2", | ||
number_of_categories=1, | ||
device_type=torch.device("cpu"), | ||
) | ||
|
||
# @pytest.fixture | ||
# def model(): | ||
# return TextClassifiers( | ||
# repository_id="Sandrro/text_to_subfunction_v10", | ||
# number_of_categories=1, | ||
# device_type=torch.device("cpu"), | ||
# ) | ||
|
||
# def test_cats_probs(model, test_data): | ||
# expected_df = pd.DataFrame( | ||
# { | ||
# "cats": [ | ||
# "Вопросы граждан о проектах/планах/сроках/ходе проведения работ по благоустройству", | ||
# "Не ЦУР", | ||
# "Вопросы по оплате проезда в общественном транспорте", | ||
# ], | ||
# "probs": ["1.0", "0.999", "0.98"], | ||
# } | ||
# ) | ||
|
||
# test_data[["cats", "probs"]] = pd.DataFrame( | ||
# test_data["Текст"].progress_map(lambda x: model.run_text_classifier_topics(x)).to_list() | ||
# ) | ||
# assert test_data["cats"].equals(expected_df["cats"]) | ||
# assert test_data["probs"].equals(expected_df["probs"]) | ||
def test_cats_probs(model, sample_dataframe): | ||
sample_dataframe[["cats", "probs"]] = sample_dataframe["Текст комментария"].progress_map(lambda x: model.run_text_classifier(x)).to_list() | ||
print(sample_dataframe) | ||
assert sample_dataframe.iloc[0]["cats"] == "ЖКХ" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import pytest | ||
import torch | ||
import pandas as pd | ||
from sloyka import EmotionRecognizer | ||
|
||
@pytest.fixture | ||
def sample_dataframe(): | ||
s_data = {'Текст комментария': {203: 'На Чайковского 63 тоже идет кап.ремонт. В квартире у пенсионеров побили стекла. Куда им обратиться?', | ||
204: 'Вся улица Жуковского и Восстания заклеена рекламой! Почему не действует полиция и администрация с ЖСК-1 ?'}, | ||
'message_id': {203: 195, 204: 196}} | ||
return pd.DataFrame(s_data) | ||
|
||
@pytest.fixture | ||
def model(): | ||
return EmotionRecognizer() | ||
|
||
def test_emotion_recognizer(model, sample_dataframe): | ||
sample_dataframe["emotion"] = sample_dataframe["Текст комментария"].progress_map(lambda x: model.recognize_emotion(x)) | ||
print(sample_dataframe) | ||
assert sample_dataframe.iloc[0]["emotion"] == "neutral" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.