was successfully added to your cart.

One-Liner Magic with Spark NLP: Deep Learning for NER in Documents 2/2

We are going to use John Snow Labs NLP library with visual features installed to do whatever we did in the first part of the post Named Entity Recognition in Documents with Transformer Models using Visual-NLP 1/2 but just in a single line of code!

Imagine being able to predict with any of the 40,000+ pre-trained models or even train new ones, all in a single line of code! That’s the power of nlp.load().

All we have to do is simply load the model:

You can run the following code from here: Colab

Using John Snow Labs one liner code

Now, to predict on the image:

Now let’s predict on the image!

Loading the model

We have successfully predicted on the image, now let’s look at the results.

Warning::Spark Session already created, some configs may not take.
|    |   entities_confidence | entities_ner_entity   |   entities_x_location |   entities_y_location | path                                                                |
|---:|----------------------:|:----------------------|----------------------:|----------------------:|:--------------------------------------------------------------------|
|  0 |                   106 | version               |                  1027 |                    89 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    67 | :                     |                  1027 |                    89 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    95 | study                 |                  1020 |                   128 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    77 | id                    |                  1088 |                   128 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    41 | :                     |                  1088 |                   128 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    86 | institution           |                   407 |                   190 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    45 | name                  |                   667 |                   190 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   102 | institution           |                   498 |                   276 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    67 | address               |                   618 |                   276 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   103 | institution           |                   454 |                   339 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    82 | address               |                   575 |                   339 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    98 | line                  |                   673 |                   339 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    72 | #                     |                   724 |                   339 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    65 | 2                     |                   724 |                   339 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    88 | telephone             |                   497 |                   402 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    64 | &                     |                   622 |                   402 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    88 | email                 |                   645 |                   402 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   108 | name                  |                    58 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    84 | :                     |                    58 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   108 | dribbler              |                   143 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    86 | ,                     |                   143 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   107 | aaa                   |                   244 |                   483 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   106 | bbb                   |                   289 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   107 | study                 |                   431 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    97 | date                  |                   500 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   103 | :                     |                   500 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   105 | 12                    |                   568 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   100 | -                     |                   568 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   103 | 09                    |                   568 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    99 | -                     |                   568 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   101 | 2006                  |                   568 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    88 | ,                     |                   568 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   106 | 6                     |                   705 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    89 | :                     |                   705 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    96 | 34                    |                   705 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   102 | bp                    |                   790 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    88 | :                     |                   790 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   108 | 120                   |                   835 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   106 | /                     |                   835 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   106 | 80                    |                   835 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    89 | mmhg                  |                   926 |                   478 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   105 | pm                    |                   432 |                   509 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   111 | mrn                   |                    58 |                   547 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   101 | :                     |                    58 |                   547 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    99 | 12341820060912        |                   130 |                   547 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   108 | patient               |                   432 |                   547 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    70 | location              |                   514 |                   547 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   104 | :                     |                   514 |                   547 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    63 | room                  |                   626 |                   547 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    99 | hr                    |                   790 |                   547 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    95 | :                     |                   790 |                   547 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   101 | 100                   |                   840 |                   547 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   100 | bpm                   |                   883 |                   547 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   111 | dob                   |                    58 |                   586 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    99 | :                     |                    58 |                   586 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   106 | 19                    |                   122 |                   586 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   102 | -                     |                   122 |                   586 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   105 | 06                    |                   122 |                   586 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   102 | -                     |                   122 |                   586 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   105 | 1979                  |                   122 |                   586 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   100 | (                     |                   258 |                   582 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    81 | dd                    |                   258 |                   582 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    95 | -                     |                   258 |                   582 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    95 | mm                    |                   258 |                   582 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    97 | -                     |                   258 |                   582 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   100 | gender                |                   431 |                   586 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    99 | :                     |                   431 |                   586 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    72 | male                  |                   530 |                   586 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   106 | height                |                   790 |                   586 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    95 | :                     |                   790 |                   586 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    88 | 123                   |                   880 |                   586 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    77 | cm                    |                   923 |                   591 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    80 | yyyy                  |                    56 |                   617 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   109 | age                   |                    56 |                   655 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    92 | :                     |                    56 |                   655 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   101 | 27                    |                   117 |                   655 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    51 | years                 |                   147 |                   655 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   103 | weight                |                   788 |                   655 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    98 | :                     |                   788 |                   655 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   102 | 25                    |                   883 |                   655 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    57 | kg                    |                   914 |                   655 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   110 | reason                |                    58 |                   697 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    76 | for                   |                   146 |                   697 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    85 | study                 |                   186 |                   697 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    80 | :                     |                   186 |                   697 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   102 | mi                    |                   268 |                   697 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   102 | bsa                   |                   790 |                   697 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    94 | :                     |                   790 |                   697 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   107 | 0                     |                   848 |                   697 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   105 | .                     |                   848 |                   697 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    97 | 92                    |                   848 |                   697 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    98 | m                     |                   898 |                   697 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   107 | history               |                    58 |                   739 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    96 | :                     |                    58 |                   739 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   105 | asfgfdgsdg            |                   153 |                   739 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   104 | medications           |                    58 |                   778 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    96 | :                     |                    58 |                   778 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   106 | heparine              |                   211 |                   778 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   108 | ,                     |                   211 |                   778 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   105 | paracetamol           |                   323 |                   778 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   102 | summary               |                    56 |                   827 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    69 | statements            |                   181 |                   827 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    42 | .                     |                   381 |                   866 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    75 | two                   |                   472 |                   866 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    82 | -                     |                   472 |                   866 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    78 | dimensional           |                   472 |                   866 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    97 | transthoracic         |                   668 |                   866 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    85 | echocardiogram        |                   821 |                   866 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    40 | was                   |                  1009 |                   871 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    73 | performed             |                    57 |                   897 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    78 | .                     |                    57 |                   897 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    53 | the                   |                   183 |                   897 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    38 | study                 |                   230 |                   897 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    33 | technically           |                   344 |                   897 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    32 | limited               |                   472 |                   897 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    46 | .                     |                   472 |                   897 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    53 | there                 |                    55 |                   935 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    55 | is                    |                   126 |                   935 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    85 | no                    |                   150 |                   940 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    30 | thrombus              |                   183 |                   935 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    65 | .                     |                   183 |                   935 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   100 | preliminary           |                    57 |                   966 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    58 | test                  |                   187 |                   962 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    61 | report                |                   238 |                   968 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    75 | .                     |                   238 |                   968 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   100 | amended               |                    56 |                   997 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   100 | .                     |                    56 |                   997 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    43 | was                   |                   106 |                  1033 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    57 | .                     |                   382 |                  1028 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    93 | the                   |                    55 |                  1060 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    66 | left                  |                   103 |                  1060 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    63 | ventricle             |                   143 |                  1060 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    75 | is                    |                   248 |                  1060 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    80 | grossly               |                   271 |                  1060 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    53 | normal                |                   358 |                  1060 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    46 | size                  |                   443 |                  1060 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    56 | .                     |                   443 |                  1060 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    92 | the                   |                    55 |                  1091 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    81 | right                 |                   103 |                  1091 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    63 | atrium                |                   160 |                  1091 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    74 | is                    |                   240 |                  1091 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    85 | moderately            |                   264 |                  1091 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    65 | dilated               |                   396 |                  1091 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    73 | .                     |                   396 |                  1091 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   106 | 213                   |                    56 |                  1185 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    73 | 321                   |                    56 |                  1216 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                   101 | 321                   |                    56 |                  1247 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    82 | 231                   |                    56 |                  1278 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    89 | 231                   |                    56 |                  1310 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    87 | 3                     |                    56 |                  1341 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    90 | 21421                 |                    56 |                  1372 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    80 | yeyeyyayaya           |                    55 |                  1409 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    81 | left                  |                    57 |                  1480 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    56 | ventricle             |                   107 |                  1480 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    88 | the                   |                    55 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    60 | left                  |                   103 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    45 | ventricle             |                   143 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    64 | is                    |                   248 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    75 | grossly               |                   271 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    48 | normal                |                   357 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    41 | size                  |                   442 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    53 | .                     |                   442 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    61 | there                 |                   496 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    57 | is                    |                   567 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    46 | no                    |                   591 |                  1524 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    45 | thrombus              |                   623 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    65 | .                     |                   623 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    76 | there                 |                   745 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    56 | is                    |                   816 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    68 | global                |                   839 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    81 | thinning              |                   913 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    83 | of                    |                  1014 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    58 | the                   |                  1041 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    76 | left                  |                  1085 |                  1519 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    62 | ventricular           |                    55 |                  1546 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    55 | walls                 |                   177 |                  1550 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    81 | .                     |                   177 |                  1550 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    79 | atria                 |                    55 |                  1591 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    89 | the                   |                    55 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    70 | left                  |                   103 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    59 | atrial                |                   144 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    53 | size                  |                   206 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    60 | is                    |                   256 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    76 | normal                |                   280 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    89 | .                     |                   280 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    79 | right                 |                   371 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    58 | atrium                |                   434 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    75 | is                    |                   515 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    78 | small                 |                   538 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    91 | .                     |                   538 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    90 | the                   |                   609 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    72 | right                 |                   658 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    66 | atrium                |                   715 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    71 | is                    |                   796 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    91 | moderately            |                   820 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    72 | dilated               |                   952 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |
|  0 |                    93 | .                     |                   952 |                  1630 | file:/F:/Work/repos/nlu_new/ner/nlu/tests/nlu_ocr_tests/ocr_ner.png |

Indeed! With John Snow Labs NLP, NER becomes a breeze. Gone are the days of painstakingly creating a pipeline and making predictions. Now, we can accomplish all of this in a flash with just a single line of code! It’s not only efficient but also a real time-saver.

Summary

In this article, we’ve taken a deep dive into the process of creating a pipeline for NER using John Snow Labs library with visual features installed. We’ve seen how the powerful tools provided by John Snow Labs can simplify this process, allowing us to perform complex tasks with just a single line of code. This not only makes the process more efficient but also saves us a significant amount of time.

Resources

How useful was this post?

Try The Generative AI Lab - No-Code Platform For Model Tuning & Validation

See in action
Our additional expert:
đź‘‹ I am a Computer Science Senior who juggles his studies and life as a Data Scientist. âš“ I am Currently working at John Snow Labs as a Data Scientist and maintaining/contributing to the SparkNLP library.

Named Entity Recognition in Documents with Transformer Models using Visual-NLP 1/2

This article will delve into the significance of NER (Named Entity Recognition) detection in OCR (Optical Character Recognition) and showcase its application...
preloader