From 9505af2876ef7542df856d4ab9245ef6cb8cfb2e Mon Sep 17 00:00:00 2001 From: Gabo Date: Thu, 14 Nov 2024 12:18:09 +0100 Subject: [PATCH] Fix xml paths --- requirements.txt | 2 +- src/Extractor.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 81a036b..5ca74cc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,4 @@ sentry-sdk==2.8.0 redis==5.0.7 requests==2.32.3 git+https://github.com/huridocs/queue-processor@2a961d0f3e579a63a439da058a023d04973449b2 -git+https://github.com/huridocs/trainable-entity-extractor@58474952f106b6cb31abbff5d35a8164afafd0bd \ No newline at end of file +git+https://github.com/huridocs/trainable-entity-extractor@ecaaf62f73d8490e07c0e2c0fd51f30cc2f9e85b \ No newline at end of file diff --git a/src/Extractor.py b/src/Extractor.py index 76f2166..4c1b029 100755 --- a/src/Extractor.py +++ b/src/Extractor.py @@ -120,7 +120,7 @@ def get_prediction_data_from_db(self): return prediction_data_list def delete_training_data(self): - training_xml_path = XmlFile.get_xml_folder_path(extraction_identifier=self.extraction_identifier, to_train=True) + training_xml_path = XmlFile(extraction_identifier=self.extraction_identifier, to_train=True).xml_folder_path send_logs(self.extraction_identifier, f"Deleting training data in {training_xml_path}") shutil.rmtree(training_xml_path, ignore_errors=True) self.pdf_metadata_extraction_db.labeled_data.delete_many(self.mongo_filter) @@ -130,7 +130,7 @@ def insert_suggestions_in_db(self, suggestions: list[Suggestion]) -> (bool, str) return False, "No data to calculate suggestions" self.pdf_metadata_extraction_db.suggestions.insert_many([x.to_dict() for x in suggestions]) - xml_folder_path = XmlFile.get_xml_folder_path(extraction_identifier=self.extraction_identifier, to_train=False) + xml_folder_path = XmlFile(extraction_identifier=self.extraction_identifier, to_train=False).xml_folder_path for suggestion in suggestions: entity_name = {"entity_name": suggestion.entity_name, "xml_file_name": ""} xml_file_name = {"xml_file_name": suggestion.xml_file_name, "entity_name": ""}