Skip to content

Commit

Permalink
Fix xml paths
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-piles committed Nov 14, 2024
1 parent 7b4b186 commit 9505af2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
git+https://github.com/huridocs/trainable-entity-extractor@ecaaf62f73d8490e07c0e2c0fd51f30cc2f9e85b
4 changes: 2 additions & 2 deletions src/Extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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": ""}
Expand Down

0 comments on commit 9505af2

Please sign in to comment.