Files
ds_citationpro/detector.py
T
timothyafolami e930ccd308 progress update
2024-11-23 20:44:04 +01:00

18 lines
703 B
Python

from utils import document_to_images, evaluate_images_for_citations, process_document_errors, delete_folder
from loguru import logger
def detect_doc_issues(file_path: str):
logger.info("Converting the docs to images")
image_path = document_to_images(file_path)
print(image_path)
logger.info("Getting the errors in the Doc")
doc_errors = evaluate_images_for_citations("output_images")
logger.info("Getting the reference documents")
errors_solution = process_document_errors(doc_errors)
logger.info("Deleting the image_path")
deleted = delete_folder("output_images")
return errors_solution
errors = detect_doc_issues("samples/Bad APA/Bad 5.docx")
print(errors)