From 0f485b1aadfc595797bddd20ffadf2f9bf79f7ab Mon Sep 17 00:00:00 2001 From: Ekaterina Voloshina <42929264+EkaterinaVoloshina@users.noreply.github.com> Date: Fri, 15 Sep 2023 19:07:50 +0300 Subject: [PATCH 1/4] fixed indices --- probing/ud_filter/filtering_probing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/probing/ud_filter/filtering_probing.py b/probing/ud_filter/filtering_probing.py index d114353..9f98268 100644 --- a/probing/ud_filter/filtering_probing.py +++ b/probing/ud_filter/filtering_probing.py @@ -70,9 +70,11 @@ def upload_files( list_texts = [read(p) for p in self.paths] conllu_data = "\n".join(list_texts) - + conllu_data = re.sub(r'\d+\-\d+.*\n', '', conllu_data) + self.language = extract_lang_from_udfile_path(self.paths[0], language=language) self.sentences = parse(conllu_data) + print(self.sentences) def _filter_conllu(self, class_label: str) -> Tuple[List[str], List[str]]: """Filters sentences by class's query and saves the result to the relevant fields""" From 7d4852102bd10fbc2559532ed2c2599b31a01ffc Mon Sep 17 00:00:00 2001 From: Ekaterina Voloshina <42929264+EkaterinaVoloshina@users.noreply.github.com> Date: Mon, 18 Sep 2023 11:36:59 +0300 Subject: [PATCH 2/4] fixed typos --- probing/ud_filter/filtering_probing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/probing/ud_filter/filtering_probing.py b/probing/ud_filter/filtering_probing.py index 9f98268..3926fe3 100644 --- a/probing/ud_filter/filtering_probing.py +++ b/probing/ud_filter/filtering_probing.py @@ -70,8 +70,8 @@ def upload_files( list_texts = [read(p) for p in self.paths] conllu_data = "\n".join(list_texts) - conllu_data = re.sub(r'\d+\-\d+.*\n', '', conllu_data) - + conllu_data = re.sub(r"\d+\-\d+.*\n", "", conllu_data) + self.language = extract_lang_from_udfile_path(self.paths[0], language=language) self.sentences = parse(conllu_data) print(self.sentences) From 79ff6bd37d35cf6c54b91d2fe6ac1b1665560bf2 Mon Sep 17 00:00:00 2001 From: Ekaterina Voloshina <42929264+EkaterinaVoloshina@users.noreply.github.com> Date: Mon, 4 Dec 2023 17:01:15 +0300 Subject: [PATCH 3/4] fixed pr --- probing/ud_filter/filtering_probing.py | 1 - 1 file changed, 1 deletion(-) diff --git a/probing/ud_filter/filtering_probing.py b/probing/ud_filter/filtering_probing.py index 3926fe3..d3d6bfb 100644 --- a/probing/ud_filter/filtering_probing.py +++ b/probing/ud_filter/filtering_probing.py @@ -74,7 +74,6 @@ def upload_files( self.language = extract_lang_from_udfile_path(self.paths[0], language=language) self.sentences = parse(conllu_data) - print(self.sentences) def _filter_conllu(self, class_label: str) -> Tuple[List[str], List[str]]: """Filters sentences by class's query and saves the result to the relevant fields""" From b9f2774bea69a53fabf8c98a0cbf8102d55eb586 Mon Sep 17 00:00:00 2001 From: Ekaterina Voloshina <42929264+EkaterinaVoloshina@users.noreply.github.com> Date: Wed, 20 Dec 2023 23:49:01 +0300 Subject: [PATCH 4/4] fixed tests --- tests/filter_test/test_filtering_probing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/filter_test/test_filtering_probing.py b/tests/filter_test/test_filtering_probing.py index 01283b7..d664284 100644 --- a/tests/filter_test/test_filtering_probing.py +++ b/tests/filter_test/test_filtering_probing.py @@ -150,7 +150,7 @@ def test_filter_and_convert_all_saved(self): save_dir_path=task_dir.name, task_name="cl", ) - self.assertEqual(queries_sents, self.probing_filter.probing_dict) + self.assertCountEqual(queries_sents, self.probing_filter.probing_dict) with open(f"{task_dir.name}/ru_taiga_cl.csv") as f: self.assertEqual(27, len(f.readlines())) task_dir.cleanup()