add logs
This commit is contained in:
parent
e188f8a1f6
commit
ab031a1d30
@ -60,15 +60,25 @@ public class RedactionController implements RedactionResource {
|
||||
Document classifiedDoc = pdfSegmentationService.parseDocument(pdDocument);
|
||||
|
||||
log.info("Document structure analysis successful, starting redaction analysis...");
|
||||
long current = System.currentTimeMillis() - startTime;
|
||||
long untilNow = current;
|
||||
log.info("Document classification took: {}.", current);
|
||||
|
||||
entityRedactionService.processDocument(classifiedDoc, analyzeRequest.getRuleSetId(), analyzeRequest.getManualRedactions());
|
||||
|
||||
current = System.currentTimeMillis() - startTime - untilNow;
|
||||
untilNow = untilNow + current;
|
||||
log.info("Entity redaction took: {}.", current);
|
||||
|
||||
redactionLogCreatorService.createRedactionLog(classifiedDoc, pdDocument.getNumberOfPages(), analyzeRequest.getManualRedactions(), analyzeRequest
|
||||
.getRuleSetId());
|
||||
|
||||
current = System.currentTimeMillis() - startTime - untilNow;
|
||||
log.info("Redaction log creation took: {}.", current);
|
||||
|
||||
log.info("Redaction analysis successful...");
|
||||
log.debug("Finishing redaction analysis took: {}.", System.currentTimeMillis() - startTime);
|
||||
|
||||
|
||||
return AnalyzeResult.builder()
|
||||
.sectionGrid(classifiedDoc.getSectionGrid())
|
||||
.redactionLog(new RedactionLog(classifiedDoc.getRedactionLogEntities(), classifiedDoc.getDictionaryVersion(), classifiedDoc
|
||||
|
||||
@ -41,6 +41,8 @@ public class PdfSegmentationService {
|
||||
|
||||
log.info("Parsing document...");
|
||||
long startTime = System.currentTimeMillis();
|
||||
long current = System.currentTimeMillis() - startTime;
|
||||
long untilNow = current;
|
||||
|
||||
Document document = new Document();
|
||||
|
||||
@ -76,24 +78,55 @@ public class PdfSegmentationService {
|
||||
.getVertical());
|
||||
page.setRotation(rotation);
|
||||
|
||||
current = System.currentTimeMillis() - startTime - untilNow;
|
||||
untilNow = untilNow + current;
|
||||
log.info("Preparing page took: {}.", current);
|
||||
|
||||
tableExtractionService.extractTables(cleanRulings, page);
|
||||
|
||||
current = System.currentTimeMillis() - startTime - untilNow;
|
||||
untilNow = untilNow + current;
|
||||
log.info("Extracting tables from page took: {}.", current);
|
||||
|
||||
buildPageStatistics(page);
|
||||
|
||||
current = System.currentTimeMillis() - startTime - untilNow;
|
||||
untilNow = untilNow + current;
|
||||
log.info("Building statistics for page took: {}.", current);
|
||||
|
||||
page.setLandscape(parsedElements.isLandscape() || parsedElements.isRotated());
|
||||
|
||||
page.setPageNumber(pageNumber);
|
||||
increaseDocumentStatistics(page, document);
|
||||
|
||||
current = System.currentTimeMillis() - startTime - untilNow;
|
||||
untilNow = untilNow + current;
|
||||
log.info("Increasing statistics for page took: {}.", current);
|
||||
|
||||
page.setImageBounds(parsedElements.getImageBounds());
|
||||
pages.add(page);
|
||||
current = System.currentTimeMillis() - startTime - untilNow;
|
||||
untilNow = untilNow + current;
|
||||
log.info("Adding page took: {}.", current);
|
||||
}
|
||||
|
||||
document.setPages(pages);
|
||||
|
||||
current = System.currentTimeMillis() - startTime - untilNow;
|
||||
untilNow = untilNow + current;
|
||||
log.info("Setting pages took: {}.", current);
|
||||
|
||||
classificationService.classifyDocument(document);
|
||||
|
||||
current = System.currentTimeMillis() - startTime - untilNow;
|
||||
untilNow = untilNow + current;
|
||||
log.info("Classifying took: {}.", current);
|
||||
|
||||
sectionsBuilderService.buildSections(document);
|
||||
|
||||
current = System.currentTimeMillis() - startTime - untilNow;
|
||||
log.info("Building sections took: {}.", current);
|
||||
|
||||
log.info("Finishing document parsing took: {}.", System.currentTimeMillis() - startTime);
|
||||
|
||||
return document;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user