How to access Table tag name using java program

Amol Harde 41 Reputation points
2022-12-02T05:05:59.003+00:00

Hi All,

Ho to access Table tag name through java program using custom model.

We have trained custom model for table and give Table name as a table tag we want access this table tag in our extraction using java but we can not able this please help us how to get table tag name and for that which method used in java.

Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,480 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,531 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ramr-msft 17,641 Reputation points
    2022-12-07T11:54:35.813+00:00

    @Amol Harde Thanks, You can use the Key Value.

    // Key-value  
    analyzeResult.getKeyValuePairs().forEach(documentKeyValuePair -> {  
        System.out.printf("Key content: %s%n", documentKeyValuePair.getKey().getContent());  
        System.out.printf("Key content bounding region: %s%n",  
            documentKeyValuePair.getKey().getBoundingRegions().toString());  
      
        System.out.printf("Value content: %s%n", documentKeyValuePair.getValue().getContent());  
        System.out.printf("Value content bounding region: %s%n", documentKeyValuePair.getValue().getBoundingRegions().toString());  
    });  
    
     
    // tables  
        List<DocumentTable> tables = analyzeLayoutResult.getTables();  
        for (int i = 0; i < tables.size(); i++) {  
            DocumentTable documentTable = tables.get(i);  
            System.out.printf("Table %d has %d rows and %d columns.%n", i, documentTable.getRowCount(),  
                documentTable.getColumnCount());  
            documentTable.getCells().forEach(documentTableCell -> {  
                System.out.printf("Cell '%s', has row index %d and column index %d.%n", documentTableCell.getContent(),  
                    documentTableCell.getRowIndex(), documentTableCell.getColumnIndex());  
            });  
            System.out.println();  
        }  
    
    0 comments No comments