microsoft / table-transformer

Table Transformer (TATR) is a deep learning model for extracting tables from unstructured documents (PDFs and images). This is also the official repository for the PubTables-1M dataset and GriTS evaluation metric.
MIT License
2.01k stars 231 forks source link

Some questions about finetune with negative samples #139

Open JIBSN opened 9 months ago

JIBSN commented 9 months ago

Hi guys, I finetuned the model with a training sets with 1/3 negetive samples. It really worked in differentiate pages with tables and pure words when compared to models trained without neg samples. But I have some questions about the training.

  1. How the loss is calculated for negative samples ? I found these two lines, the bboxes and labels are all zero tensors for neg samples.

    bboxes = torch.empty((0, 4), dtype=torch.float32) labels = torch.empty((0,), dtype=torch.int64)

  2. How neg samples influence the result?

I have just entered the field of artificial intelligence and I may not be familiar with this training strategy(mixing labled samples with no labled when training). I hope someone who understands it can help explain it to me.

Thanks, chao