Extract Key Information from Documents using LayoutLM | LayoutLM Fine-tuning | Deep Learning

Video explains the architecture of LayoutLm and Fine-tuning of LayoutLM model to extract information from documents like Invoices, Receipt, Financial Documents, tables, etc.
✅ LayoutLM Annotation Tool : • Annotate Text, PDF & I...
✅ Signup for Annotation Tool : ubiai.tools/Signup?...
1. Notebook: github.com/karndeepsingh/Extr...
2. Label Studio: labelstud.io/blog/Improve-OCR...
3. LayoutLM Paper: arxiv.org/pdf/1912.13318.pdf
4. FUNSD Dataset: guillaumejaume.github.io/FUNSD/
5. github.com/NielsRogge/Transfo...
6. LayoutLM Preprocessing file: github.com/UBIAI/layout_lm_tu...
7. github.com/katanaml/sparrow
Connect with me on :
1. LinkedIn: / karndeepsingh
2. Telegram Group: telegram.me/datascienceclubac...
3. Github: www.github.com/karndeepsingh
#datascience #nlp #deeplearning #documentunderstanding

Пікірлер: 101

  • @thepresistence5935
    @thepresistence59352 жыл бұрын

    Thankyou so much for wonderful explanation!

  • @ShivShankarDutta1
    @ShivShankarDutta12 жыл бұрын

    Excellent explanation

  • @lioneluran
    @lioneluran Жыл бұрын

    Great tutorial! How do you know which "answer" belongs to which "question"? Is that somehow part of the model output or does it merely "tag" each token? Thanks!

  • @amitday5957
    @amitday59572 жыл бұрын

    excellent. thanks

  • @iwaqas
    @iwaqas Жыл бұрын

    I want to use my own dataset already annotated using IOB format json file. Possible to use it as is? Or do I need to translate it to the json format similar to the FUNSD dataset? If yes, is there any (free) converter/translator available to transform the annotation format?

  • @vcjayan8206
    @vcjayan8206 Жыл бұрын

    Hi Karndeep, for a custom invoices parameters extraction while annotating the label, shoul i do it as question answer style ? Like invoice number question, invoice number answer? Or just annotate the answer part only?

  • @TheMarComplex
    @TheMarComplex Жыл бұрын

    Thank you!

  • @DeepakSingh-ji3zo
    @DeepakSingh-ji3zo Жыл бұрын

    @Karndeep Singh Will we be able to tag data in FUNSD format using Label Studio?( UBIAI is an online tool, so we can not send our data outside the network)

  • @SushantiBhagwat
    @SushantiBhagwat Жыл бұрын

    Hi @Karndeep Singh...I am using my own dataset and Let us say I want to annotate 3 labels "DATE" , "INVOICE NUMBER" and "OTHER".. So will it possible to automatically annotate rest of all tokens with "OTHER" label Using Layoutlmv3 ?

  • @rebeiamal705
    @rebeiamal7052 жыл бұрын

    Excellent

  • @parandhamuduchakali333
    @parandhamuduchakali3339 ай бұрын

    great tutorial , shall make small video from custom layoutml model please

  • @goelnikhils
    @goelnikhils Жыл бұрын

    Amazing Video. Thanks a lot Kamaldeep

  • @gopipatwa4593
    @gopipatwa4593 Жыл бұрын

    Hello I have doubt how may i create personal dataset? Is there any tools or other method?

  • @henkhbit5748
    @henkhbit57482 жыл бұрын

    Another nice tutorial about layoutlm. Btw: the annotation process is quite a tedious task... Could u also make a tutorial how to cluster relevant keywords in a document? Thanks👍

  • @karndeepsingh

    @karndeepsingh

    2 жыл бұрын

    Sure

  • @joseph0x45

    @joseph0x45

    2 жыл бұрын

    @@karndeepsingh Great, I'm also looking ahead for that tutorial. Subsribed😁

  • @user-lf8rc5jj5y
    @user-lf8rc5jj5y4 ай бұрын

    Hello, I would like to know if we prepar data with another tool other than UBIAI. I couldn't sign in to the platform.

  • @chinjumurali1622
    @chinjumurali16222 жыл бұрын

    can you please share the github link of this code.It will be very helpfull.

  • @hd-dc8qq
    @hd-dc8qq2 жыл бұрын

    Wow, ready a great video. Just out of curiosity, what is the specs of the hardware or service you are using. How Long do you think it will take to train 5000 annotated documents.

  • @karndeepsingh

    @karndeepsingh

    2 жыл бұрын

    It used GTX1080 and it should take atleast 2hrs-3hrs to train

  • @tadakantisreeja6133
    @tadakantisreeja61337 ай бұрын

    Hello Sir, it was an excellent tutorial but I am unable to install unilm/layoutlm as collab has python version 3.11 by default. I downgraded python version to 3.7 and tried running again now transformers are not installed properly. Please help me.

  • @user-eb1cx3bz5u
    @user-eb1cx3bz5u Жыл бұрын

    there is an issue with downloading decencies when we install layoutlm from unilm

  • @7_bairapraveen928
    @7_bairapraveen928 Жыл бұрын

    The only doubt is how can we get the output in key-value pairs

  • @keithfernandes6152
    @keithfernandes61522 жыл бұрын

    How to annotate scanned pdf?.

  • @tejareddy4416
    @tejareddy4416 Жыл бұрын

    How to train a custom model for key value extraction

  • @BaoTran-jo8lj
    @BaoTran-jo8lj11 ай бұрын

    Hi, I have an urgent task. Could you please help me which approach I should do to extract data from invoice images and then classify them with required fields? Thanks for your work

  • @karndeepsingh

    @karndeepsingh

    11 ай бұрын

    It depends on usecases, complexity and also how many field required to be extracted ?

  • @taherehrastegarzare9780
    @taherehrastegarzare9780Ай бұрын

    Hi, thanks for this video. I keep getting this error when I run the first block of code to clone unlim. error: subprocess-exited -with error and error: metadata-generation-failed

  • @ArunKumar-sg6jf
    @ArunKumar-sg6jf2 жыл бұрын

    can make video for layout lm v2 please

  • @italykiduniya
    @italykiduniya2 жыл бұрын

    Is there any way we can get the output of LayoutLM model as key value pairs where the question is key and the answer is the value of it.

  • @karndeepsingh

    @karndeepsingh

    2 жыл бұрын

    Yes, you can use predicted BIOES tag and right a simple code to club these predicted BIOES tags into a single word according to the tags specified

  • @nurielwainstein9022

    @nurielwainstein9022

    2 жыл бұрын

    hi, you made it? can you give any directions to achieve this pls?

  • @gauravlotey4263

    @gauravlotey4263

    7 ай бұрын

    @italykiduniya I suggest since you already know your keys why don't to through code just create your own hash data. For example in python Output_dict = {} For key in list_of_keys: Val1 = LayoutLM(doc , query)[index_of_value] Output_dict[Key] = val Please use this as an inspiration and not the exact code

  • @The-techmonk
    @The-techmonk2 жыл бұрын

    Hi Karn what is the output of this model ? position co-ordinates along with keyword? how we'll extract the data in key value pair?

  • @karndeepsingh

    @karndeepsingh

    2 жыл бұрын

    Each word BIOES tag with Bounding box information

  • @chiragkhandelwal3507

    @chiragkhandelwal3507

    2 жыл бұрын

    @@karndeepsingh how to extract that?

  • @nurielwainstein9022

    @nurielwainstein9022

    2 жыл бұрын

    hi, you made it? can you give any directions to achieve this pls?

  • @harshavardhanachyuta2055
    @harshavardhanachyuta2055 Жыл бұрын

    is the process same for pretrained layoutlmv3 model

  • @karndeepsingh

    @karndeepsingh

    Жыл бұрын

    Yes

  • @AnupamKumar-ob7ek
    @AnupamKumar-ob7ek2 жыл бұрын

    nice explaination. could you explain how to create own dataset using ocr for layoutlm

  • @karndeepsingh

    @karndeepsingh

    2 жыл бұрын

    You can use UBIAI tool to do it or else you can prepare the data on your own by extracting text wise BIOES tags and respective text bounding boxes

  • @AnupamKumar-ob7ek

    @AnupamKumar-ob7ek

    2 жыл бұрын

    @@karndeepsingh can you show me how I can prepare without any tools plz . It will be great help for me

  • @AnupamKumar-ob7ek

    @AnupamKumar-ob7ek

    2 жыл бұрын

    @@karndeepsingh sir, could you make a video without the use of UBIAI tools, It will great help for me. Thank you in advance

  • @sunitbehera597
    @sunitbehera5972 жыл бұрын

    Hi Karn, can we use it for pdf as we train NER models

  • @karndeepsingh

    @karndeepsingh

    2 жыл бұрын

    Yes

  • @anagha1615

    @anagha1615

    11 ай бұрын

    @sunitbehera597 hey did u worked on ut? Can we connect?

  • @vishnukantshukla8998
    @vishnukantshukla8998 Жыл бұрын

    Can you please let me know how can we extract that data as a text from document for further analysis. It;s very urgent Thanks

  • @karndeepsingh

    @karndeepsingh

    Жыл бұрын

    the predicted output will be in BIOEU tags associated with labels. You have club these BIOEU tags into one to form a text

  • @AdandKidda
    @AdandKidda2 жыл бұрын

    hi karan , how to extract the key-value in json at the end .

  • @karndeepsingh

    @karndeepsingh

    2 жыл бұрын

    LayoutLM outputs in BIOES format for each word. To make into a certain key, value pair just club BIOES tags for each word to make it final value. Just need to write few lines of code to accumulate the output of LayoutLM into the required formate

  • @nurielwainstein9022

    @nurielwainstein9022

    2 жыл бұрын

    hi, you made it? can you give any directions to achieve this pls?

  • @muhammedfaisalpj4810
    @muhammedfaisalpj4810 Жыл бұрын

    I have documents which is in pdf format. All documents are different. I want to extract some information from the document. What should i do? Each pdf are contains more pages 5-10.

  • @karndeepsingh

    @karndeepsingh

    Жыл бұрын

    You need to pass each page or first find the relevant page and then pass it to the trained LayoutLM model

  • @muhammedfaisalpj4810

    @muhammedfaisalpj4810

    Жыл бұрын

    @@karndeepsinghThank you for the reply. You know it has any other solution like named entity recognition?

  • @karndeepsingh

    @karndeepsingh

    Жыл бұрын

    @@muhammedfaisalpj4810 Yes you can use NER to extract relevant information from the given context. Make sure the quality of PDF or image is good before OCR otherwise it may distort the results of NER.

  • @j.k.priyadharshini9753

    @j.k.priyadharshini9753

    Жыл бұрын

    @@karndeepsinghhi, i want to extract some information from pdf and then convert to excel. I want to train a model to recognise key value pairs in my documents but how?

  • @anagha1615

    @anagha1615

    11 ай бұрын

    Hey @muhammedfaisalpj4810 did u worked on it? Can we connect?

  • @kpcreatzz7965
    @kpcreatzz7965 Жыл бұрын

    What are the algorithms used in this model ??

  • @karndeepsingh

    @karndeepsingh

    Жыл бұрын

    Combination of OCR, Vision Transformer and Roberta

  • @ericpeter9343
    @ericpeter93432 жыл бұрын

    how can annotate data and train this model on my own form data

  • @karndeepsingh

    @karndeepsingh

    2 жыл бұрын

    I have used UBIAI tool on 14 days trial to annotate the dataset. Although, you can try with label studio ( I personally haven’t tried)

  • @ericpeter9343

    @ericpeter9343

    2 жыл бұрын

    @@karndeepsingh thank you

  • @AdandKidda

    @AdandKidda

    2 жыл бұрын

    @@karndeepsingh ubiai is not allowing to annotate jpg, on free trial. any other option plz.

  • @TechnoRahul143
    @TechnoRahul1435 ай бұрын

    Can we use mutiple PDF documents to extract the information using LayoutLM?

  • @karndeepsingh

    @karndeepsingh

    5 ай бұрын

    Yes

  • @TechnoRahul143

    @TechnoRahul143

    5 ай бұрын

    Thanks @@karndeepsingh Do we have to first get the screenshot of each page in pdf and use the screenshot image one by one for processing and asking the question? Or is there any API available to directly upload the entire PDF and ask questions?

  • @pravallikav7454
    @pravallikav7454 Жыл бұрын

    can you please suggest me, how to use LayoutLMV2 for passport data extraction

  • @karndeepsingh

    @karndeepsingh

    Жыл бұрын

    For passport may be you can use Object Detection to locate the area of interest and then apply OCR on it.

  • @pravallikav7454

    @pravallikav7454

    Жыл бұрын

    @@karndeepsingh I applied ocr as I tried with easyocr. what I was doing in the process was Reader.readtext("Path of image"), then taking bounding boxes coordinates and text respectively which are having most width among all the bounding boxes in output, then I checked the text with mrz codes and converting into a data frame for convenience. Now, the problem is that sometimes S is considered as 5, and sometimes 0 is considering as O, it is because of the OCR issue I am thinking. How can I get a resolution regarding that, please help me to get out of this.

  • @karndeepsingh

    @karndeepsingh

    Жыл бұрын

    Its an issue with OCR. May be you need to change some parameters of OCR that you are using. Or May be consider using different OCR.

  • @pravallikav7454

    @pravallikav7454

    Жыл бұрын

    @karndeepsingh you are so talented. I am glad to have you here.

  • @jojushaji3010
    @jojushaji30102 жыл бұрын

    can we use pretrained model without any finetuning ,how to get results for that model

  • @karndeepsingh

    @karndeepsingh

    2 жыл бұрын

    Yes you can use pretrained model

  • @jojushaji3010

    @jojushaji3010

    2 жыл бұрын

    @@karndeepsingh how to extract the question and answer only in a key value format

  • @jojushaji3010

    @jojushaji3010

    2 жыл бұрын

    Eg:{"To" : "KA Sparrow", "From" : "DJ Landro", "Subject" : "....." }

  • @karndeepsingh

    @karndeepsingh

    2 жыл бұрын

    You can annotate question and answer formate using UBIAI tool and use DoCQA pretrained model to trained

  • @jojushaji3010

    @jojushaji3010

    2 жыл бұрын

    @@karndeepsingh can I use funds dataset to train a key value extraction model Output of the model:{"To" : "Ka", "H": "g", } Can u pls suggest me a way for this ,i want to do this on funsd dataset

  • @abdulwajid6725
    @abdulwajid67252 жыл бұрын

    Sir is there any specific tool for data annotation for this? #urgenthelp

  • @karndeepsingh

    @karndeepsingh

    2 жыл бұрын

    UBIAI

  • @harshavardhanachyuta2055

    @harshavardhanachyuta2055

    Жыл бұрын

    @@karndeepsingh if possible can you make a video on how to annotate the text using UBIAI

  • @karndeepsingh

    @karndeepsingh

    Жыл бұрын

    Sure

  • @harshavardhanachyuta2055
    @harshavardhanachyuta2055 Жыл бұрын

    The inference time is more. How can we optimise the code ?

  • @karndeepsingh

    @karndeepsingh

    Жыл бұрын

    You can try Knowledge distillation or quantisation techniques

  • @harshavardhanachyuta2055

    @harshavardhanachyuta2055

    Жыл бұрын

    @@karndeepsingh Sure will make a note and try it

  • @kgkgkkgkg
    @kgkgkkgkg2 жыл бұрын

    How to implement this solution on multipage document?

  • @karndeepsingh

    @karndeepsingh

    2 жыл бұрын

    You have to pass each page of a document into the model

  • @Kidzzz_zonee

    @Kidzzz_zonee

    2 жыл бұрын

    Yes, but won't the model get confused as the new page will have different class at the same coordinate on first page.

  • @karthikeshk6433
    @karthikeshk6433Ай бұрын

    Hello, Thank you for the precise tutorial. I'm facing issue while running 1st cell in google colab, below is the error: Collecting lxml==4.5.1 (from layoutlm==0.0) Downloading lxml-4.5.1.tar.gz (4.5 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.5/4.5 MB 16.0 MB/s eta 0:00:00 error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. Preparing metadata (setup.py) ... error error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.

  • @karthikeshk6433

    @karthikeshk6433

    Ай бұрын

    Can you help me to solve the above issue Sir? Thank you.

  • @NiketBahety
    @NiketBahety9 ай бұрын

    Hii, seems like in the latest python version it's throwing this error: ModuleNotFoundError: No module named 'layoutlm' I tried changing the python version but still doesn't work can you share updated code or how can I fix this bug Thank you

  • @banagarmahesh1747

    @banagarmahesh1747

    8 ай бұрын

    im also facing same error ,could you explain me how can i fix this bug

  • @NiketBahety

    @NiketBahety

    8 ай бұрын

    @@banagarmahesh1747 try restarting the runtime

  • @pratikpatel6967

    @pratikpatel6967

    3 ай бұрын

    @@NiketBahety did that solve?

  • @NiketBahety

    @NiketBahety

    3 ай бұрын

    @@pratikpatel6967 yes

  • @chotu8952
    @chotu89522 жыл бұрын

    Bhaia pls make a video on how to get job as fresher in data science

  • @CreatingUtopia
    @CreatingUtopia2 жыл бұрын

    How to make this dataset? any suggestion

  • @karndeepsingh

    @karndeepsingh

    2 жыл бұрын

    Use Paid tool like UBIAI

  • @imranullah3097
    @imranullah30975 ай бұрын

    Lol, do extract information in json format. Do not know how this work.

  • @parker4427
    @parker44272 жыл бұрын

    Prⓞм𝕠𝕤𝐌