Package: a-pandas-ex-tesseract-multirow-regex-fuzz
pipinstalla-pandas-ex-tesseract-multirow-regex-fuzzfroma_pandas_ex_tesseract_multirow_regex_fuzzimportpd_add_regex_fuzz_multiline,pd_add_tesseractpd_add_tesseract(tesseractpath=r"C:\Program Files\Tesseract-OCR\tesseract.exe")pd_add_regex_fuzz_multiline()df=pd.Q_Tesseract_to_DF(r'https://i.ytimg.com/vi/fa82Qpw6lyE/hqdefault.jpg')Tesseract results in a DataFrame (from url, path, PIL, cv2)levelpage_numblock_numpar_num...widthheightconftext01100...480360-112110...275177-123111...258109-134111...22219-145111...231495.939438No55111...331696.663704stop65111...421893.283119signs,75111...651982.424248speedin'85111...371596.098083limit94111...24519-1105111...741979.710175Nobody's115111...491495.714142gonna125111...371496.856789slow135111...24995.754181me145111...431496.090439down154111...20919-1165111...321596.436874Like175111...81096.436874a185111...491894.924347wheel,195111...491492.669563gonna205111...321896.724014spin215111...121495.647652itFuzzsearch in multiple rows in a DataFrame - works with any DataFrame, not only tesseract DataFramesfuzzdfsearch=df.ds_fuzz_multirow(column='text',fuzzsearch='Rocking BAND')levelpage_numblock_numpar_numline_numword_numlefttopwidthheightconftextaa_weightedaa_lenaa_npsumaa_weightaa_whole_textold_indexaa_whole_text_lenaa_whole_text_len_differenceaa_npsumaa_weightaa_whole_textaa_whole_text_lenaa_whole_text_len_difference1180.000000rockin' band    12                0                                 5         1          1        2         1         4   128  194     55      14  86.868996   rockin'90.00000071180.000000rockin' band          0                 12                             00511215188194401496.840813band90.00000041180.000000rockin' band          1                 12                             0130.000000Playin’in10251121137194531941.302063Playin’40.00000071130.000000Playin’in12102251121295194141495.126900in90.00000021130.000000Playin’in13102122.142857promiseland120511417207239641995.758591promise45.00000071122.142857promiseland221200511418276239361489.825577land77.14285741122.142857promiseland2312096.428571Satan!Paid11151115274172491496.457039Satan!45.0000006196.428571Satan!Paid561111511153128171341596.457039Paid51.4285714196.428571Satan!Paid5711193.857143spinit75511135197127321896.724014spin48.8571434193.857143spinit60755511136234127121495.647652it45.0000002193.857143spinit617590.000000Lookat75511313134216381596.986824Look45.0000004190.000000Lookat28755511314177219151295.994835at45.0000002190.000000Lookat297584.428571Likea6651113137126321596.436874Like24.4285714184.428571Likea246665111327413181096.436874a60.0000001184.428571Likea256679.200000wayto66511414123244301496.982368way34.2000003179.200000wayto54666511415158241151296.969261to45.0000002179.200000wayto556676.950000signs,speedin' 15                3                                 5         1          1        1         1         3   104   82     42      18  93.283119    signs,    42.750000       6         1   76.950000  signs, speedin'62153351111415281651982.424248speedin'    34.200000       8         1   76.950000  signs, speedin'6315375.461538Nobody's gonna  14                2                                 5         1          1        1         2         1    37  104     74      19  79.710175  Nobody's39.4615388175.461538Nobody's gonna         32                 14                             22511122115109491495.714142gonna36.0000005175.461538Nobody's gonna         33                 14                             275.000000Nostop755111113782231495.939438No45.0000002175.000000Fuzzsearch in multiple rows in a Series - works with any Series, not only tesseract Seriesfuzzcolumnsearch=df.text.ds_fuzz_multirow(fuzzsearch='Rocking BAND')aa_npsumaa_weightaa_whole_textaa_whole_text_lenaa_whole_text_len_difference1180.000000rockin' band    12                0                              rockin'90.00000071180.000000rockin' band          0                 12                             00band90.00000041180.000000rockin' band          1                 12                             0130.000000Playin’in102Playin’40.00000071130.000000Playin’in121022in90.00000021130.000000Playin’in13102122.142857promiseland120promise45.00000071122.142857promiseland221200land77.14285741122.142857promiseland2312096.428571Satan!Paid111Satan!45.0000006196.428571Satan!Paid56111Regex search in multiple rows in a DataFrame  - works with any DataFrame, not only tesseract DataFrames Only shows regex results that span over multiple rows!levelpage_numblock_numpar_numline_numword_numlefttopwidthheightconftextaa_regex_resultsaa_startaa_end011000000480360-1<NA><NA><NA>12110003781275177-1<NA><NA><NA>23111003781258109-1<NA><NA><NA>3411110378122219-1<NA><NA><NA>45111113782231495.939438No<NA><NA><NA>55111126684331696.663704stop<NA><NA><NA>651111310482421893.283119signs,<NA><NA><NA>751111415281651982.424248speedin'             <NA>     <NA>   <NA>851111522281371596.098083limit<NA><NA><NA>94111203710424519-1<NA><NA><NA>1051112137104741979.710175Nobody's             <NA>     <NA>   <NA>11511122115109491495.714142gonna<NA><NA><NA>12511123169104371496.856789slow<NA><NA><NA>1351112421010924995.754181me<NA><NA><NA>14511125239104431496.090439down<NA><NA><NA>154111303712620919-1<NA><NA><NA>1651113137126321596.436874LikeLikea6470175111327413181096.436874aLikea6470Regex search in multiple rows in a Series  - works with any Series, not only tesseract Series Only shows regex results that span over multiple rows!regexcolumnsearch=df.text.ds_regex_multirow(r'Like\s*\b\w+\b')textaa_regex_resultsaa_startaa_end0<NA><NA><NA>1<NA><NA><NA>2<NA><NA><NA>3<NA><NA><NA>4No<NA><NA><NA>5stop<NA><NA><NA>6signs,<NA><NA><NA>7speedin'             <NA>     <NA>   <NA>8limit<NA><NA><NA>9<NA><NA><NA>10Nobody's             <NA>     <NA>   <NA>11gonna<NA><NA><NA>12slow<NA><NA><NA>13me<NA><NA><NA>14down<NA><NA><NA>15<NA><NA><NA>16LikeLikea647017aLikea647018wheel,<NA><NA><NA>19gonna<NA><NA><NA>df.text.ds_regex_multirow(r'mess.*dues')23Nobody's                                     <NA>     <NA>   <NA>24gonna<NA><NA><NA>25messmessme‘roundHeySatan!Paidmydues10814726memessme‘roundHeySatan!Paidmydues10814727‘roundmessme‘roundHeySatan!Paidmydues10814728messme‘roundHeySatan!Paidmydues10814729Heymessme‘roundHeySatan!Paidmydues10814730Satan!messme‘roundHeySatan!Paidmydues10814731Paidmessme‘roundHeySatan!Paidmydues10814732mymessme‘roundHeySatan!Paidmydues10814733duesmessme‘roundHeySatan!Paidmydues10814734<NA><NA><NA>35<NA><NA><NA>36Playin’<NA><NA><NA>