In this blog, we'll explore a complete Python solution that detects and extracts tables and text from images using libraries like Transformers, OpenCV, PaddleOCR, and easyOCR. This step-by-step breakdown includes code to detect tables, extract content from individual table cells, and retrieve any remaining text in the image. Overview When working with scanned documents, such as invoices or forms, it is essential to accurately extract both structured information (like tables) and unstructured text. The approach we’ll explore uses Microsoft's pretrained object detection model to locate tables and OCR techniques to extract the text from both table cells and the rest of the image. Steps: 1. This code first detects table using microsoft's model. and save that image which contains detected table only 2. After that, from the detected table , we make a seperate image for each cell. 3. Then we read text from the image of each cell 4. Now, to read the extra texts except for the ...
Now, two question arises. Q1 : How do we know that we have get Purity / Pure split? There are 2 methods to find it out : 1) Entropy (Good) 2) Gini Impurity (Better because it's faster) Q2 : How does the features are selected? Information Gain 1) Entropy : H ( S ) = − ∑ i = 1 c p i lo g 2 ( p i ) Where: 𝑐 c is the number of classes in the output. Example : As you can see in the above diagram, for the component 'Overcast', we have 4 yes, 0 No. Total =4 Now, let's calculate Entropy for this Component. H ( S ) = − p yes lo g 2 ( p yes ) − p no lo g 2 ( p no ) H ( S ) = − 4 4 lo g 2 ( 4 4 ) − 4 0 lo g 2 ( 4 0 ) = -1(0) - 0 ...
Comments
Post a Comment