{
  "id": 313478,
  "title": "5'th place : simultaneous span segmentation and classification + WBF",
  "content": "<p>First of all, many thanks to the Kaggle team and Feedback Prize team for hosting this competition, and congrats to all winners ! Thanks to my teammates too, namely <a href=\"https://www.kaggle.com/amedprof\" target=\"_blank\">@amedprof</a> and <a href=\"https://www.kaggle.com/crodoc\" target=\"_blank\">@crodoc</a> for their hard work and commitment during all those 3 laborious months.</p>\n<h2>At the  beginning</h2>\n<p>We struggle a lot during this comp’. We spent almost 2 months far from the bronze zone because our strategy was the exploration one. In fact, a great kernel was published by Abishek at the early beginning of the comp’ and one could just stick to it and keep tuning its hyperparameters to get a decent score (silver zone). But, we didn’t go that way and we kept exploring many ideas.</p>\n<h2>Solution approach</h2>\n<p>It seems like the go-to approach here is NER. We didn’t reinvent the wheel, we went that way as well since it seems straightfull and answers the problem quite correctly. In fact, we tested some QA approaches but not only were they too slow (training and much more inference) but they had slightly lower scores than our NER approaches. </p>\n<p><strong>Setup 1:</strong>  <em>siblings NER &amp; Span Segmentation</em><br>\nWe use a multitask approach to output the segmentation scores (multiclass classification on 3 different values: 0 for background, 1 when inside any entity and 2 for beginning) and the entity scores (15 classes). We still use 15 classes for the NER as well but before computing the class, we convert B-eginning tokens into I-nside.</p>\n<p><strong>Backbone:</strong> 5 folds Deberta-v1 Large + 5 folds Deberta-v1 xLarge  (maxlen = 1024, stride during inference, positinon_biased_inputs=False), trained 5 epochs<br>\n<strong>Scheduler:</strong> Cosine Annealing with no warmup<br>\n<strong>Optimizer:</strong> AdamW<br>\n<strong>Loss:</strong>  Cross-Entropy with dynamic cosine-based class weights. In fact we overweight rare classes (Rebuttal and Counterclaim) by starting with high values and converge to 1 on final epochs.</p>\n<p><strong>Setup 2:</strong>  <em>Pure NER over 15 classes</em>, alternatively over 10 classes by removing the B target for non-overlapping classes.<br>\n<strong>Backbone:</strong> 5 folds Deberta Large + 5 folds Deberta xLarge  (maxlen = 1024, stride during inference,  positinon_biased_inputs=False), trained 5 epochs<br>\n<strong>Scheduler:</strong> Polynomial decay  with 10% warmup<br>\n<strong>Optimizer:</strong> AdamW<br>\n<strong>Loss:</strong>  Cross-Entropy (no weights over classes)</p>\n<h2>Validation strategy</h2>\n<p>We used same validation strategy as the one shared by Abishek we also use an enhanced version of the clustesr made by cdeotte to make our MultilabelStratifiedKFold.<br>\nThese folds were really stable and CV to LB correlation was great.</p>\n<h2>Post-processing and ensembling models &amp; boxes</h2>\n<p>As cdeotte’s team, we make use of WBF on our final solutions. WBF was very effective and was the main ingredient behind our spectacular jump in the final days of the competition. Take a look on this tab for further details about CV / LB.</p>\n<p><img src=\"https://i.ibb.co/Ntx57Gz/image.png\" alt=\"cv/lb before and after wbf\"></p>\n<h2>What works</h2>\n<ul>\n<li>Filtering on num_tokens and score</li>\n<li>Smart boxe ensembling (WBF)</li>\n<li>Random Masking</li>\n<li>Random  start (if not striding during training)</li>\n<li>Small batch size</li>\n<li>Small learning rates</li>\n</ul>\n<h2>What doesn’t work</h2>\n<ul>\n<li>Training on longer sequences</li>\n<li>Training long text aware models : LongFormer, Funnel and BigBird wasn’t better than deberta-v1 for us.</li>\n<li>More epochs, higher batch size</li>\n<li>Training on cleaned data</li>\n<li>Using better word splitter than python split</li>\n<li>QA instead of NER</li>\n<li>Simply bagging models by averaging word level scores</li>\n</ul>\n<h2>Final thoughts</h2>\n<ul>\n<li><p><strong>Training on 10 labels</strong><br>\nWe saw in <a href=\"https://www.kaggle.com/ibrezmohd/feedback-price-eda-markov-transition-matrix\" target=\"_blank\">this kernel</a>'s markov transition matrix that some <em>discourse_types</em> never overlap so we decide to use B-I-O only on Claim and Evidence and binary target for others.</p></li>\n<li><p><strong>positinon_biased_inputs = False</strong><br>\nThe HuggingFace Debrta-v1 version has positinon_biased_inputs parameter set to False by default, so Deberta-v1 is not using global position information by default. We manage to turn global position ON but the perfs are not much better than the vanilla one. Furthermore, turning positinon_biased_inputs OFF allows to use maxlen above 512 without the need to resize the embedding layers.</p></li>\n</ul>\n<p>Thanks for reading our solution.</p>\n<h3>Edit</h3>\n<ul>\n<li><strong>Setup 1 source code</strong>: <a href=\"https://github.com/neroksi/fprize_final_cleanup\" target=\"_blank\">https://github.com/neroksi/fprize_final_cleanup</a></li>\n<li><strong>Setup 2 source code</strong>: <a href=\"https://github.com/crodoc/feedback-prize\" target=\"_blank\">https://github.com/crodoc/feedback-prize</a></li>\n</ul>",
  "comments": [
    {
      "id": 1725706,
      "author_name": "KhanhVD",
      "author_url": "",
      "post_date": "2022-03-17T10:56:54.170000",
      "content": "<p>Congrats on 5th place and prize money <a href=\"https://www.kaggle.com/kneroma\" target=\"_blank\">@kneroma</a> <a href=\"https://www.kaggle.com/amedprof\" target=\"_blank\">@amedprof</a> and <a href=\"https://www.kaggle.com/crodoc\" target=\"_blank\">@crodoc</a>. Your team has big jumps in the last days, good job! </p>",
      "votes": 7,
      "replies": [
        {
          "id": 1725863,
          "author_name": "CroDoc",
          "author_url": "",
          "post_date": "2022-03-17T13:40:26.130000",
          "content": "<p>Thank you <a href=\"https://www.kaggle.com/duykhanh99\" target=\"_blank\">@duykhanh99</a>. Did you see <a href=\"https://www.kaggle.com/tascj0\" target=\"_blank\">@tascj0</a>? This guy is just WOW! I am always amazed when someone gets such a good results with so little submissions. Just awesome.</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 1725945,
          "author_name": "KhanhVD",
          "author_url": "",
          "post_date": "2022-03-17T14:31:31.777000",
          "content": "<p>He is outlier :))</p>",
          "votes": 6,
          "replies": []
        },
        {
          "id": 1726016,
          "author_name": "kkiller",
          "author_url": "",
          "post_date": "2022-03-17T15:25:38.127000",
          "content": "<p>Thanks <a href=\"https://www.kaggle.com/duykhanh99\" target=\"_blank\">@duykhanh99</a> </p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1725958,
      "author_name": "gezi",
      "author_url": "",
      "post_date": "2022-03-17T14:39:29.960000",
      "content": "<p>Thanks for sharing, better decode(GBDT sentence classification, WBF ensemble, Yolo like span detection, beam search) is the key for being on the top!</p>",
      "votes": 2,
      "replies": [
        {
          "id": 1726019,
          "author_name": "kkiller",
          "author_url": "",
          "post_date": "2022-03-17T15:27:03.700000",
          "content": "<p>Yes ! Second stage modeling has been very important in this comp'. Relying only on the direct output of the transformer model seems to be not enough.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1726048,
          "author_name": "gezi",
          "author_url": "",
          "post_date": "2022-03-17T15:55:47.627000",
          "content": "<p>en, loss function we try to optimize has big gap with final f1:)</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "comment_count": 7,
  "messages": [
    {
      "id": 1725697,
      "postDate": "2022-03-17T10:47:54.623Z",
      "content": "<p>First of all, many thanks to the Kaggle team and Feedback Prize team for hosting this competition, and congrats to all winners ! Thanks to my teammates too, namely <a href=\"https://www.kaggle.com/amedprof\" target=\"_blank\">@amedprof</a> and <a href=\"https://www.kaggle.com/crodoc\" target=\"_blank\">@crodoc</a> for their hard work and commitment during all those 3 laborious months.</p>\n<h2>At the  beginning</h2>\n<p>We struggle a lot during this comp’. We spent almost 2 months far from the bronze zone because our strategy was the exploration one. In fact, a great kernel was published by Abishek at the early beginning of the comp’ and one could just stick to it and keep tuning its hyperparameters to get a decent score (silver zone). But, we didn’t go that way and we kept exploring many ideas.</p>\n<h2>Solution approach</h2>\n<p>It seems like the go-to approach here is NER. We didn’t reinvent the wheel, we went that way as well since it seems straightfull and answers the problem quite correctly. In fact, we tested some QA approaches but not only were they too slow (training and much more inference) but they had slightly lower scores than our NER approaches. </p>\n<p><strong>Setup 1:</strong>  <em>siblings NER &amp; Span Segmentation</em><br>\nWe use a multitask approach to output the segmentation scores (multiclass classification on 3 different values: 0 for background, 1 when inside any entity and 2 for beginning) and the entity scores (15 classes). We still use 15 classes for the NER as well but before computing the class, we convert B-eginning tokens into I-nside.</p>\n<p><strong>Backbone:</strong> 5 folds Deberta-v1 Large + 5 folds Deberta-v1 xLarge  (maxlen = 1024, stride during inference, positinon_biased_inputs=False), trained 5 epochs<br>\n<strong>Scheduler:</strong> Cosine Annealing with no warmup<br>\n<strong>Optimizer:</strong> AdamW<br>\n<strong>Loss:</strong>  Cross-Entropy with dynamic cosine-based class weights. In fact we overweight rare classes (Rebuttal and Counterclaim) by starting with high values and converge to 1 on final epochs.</p>\n<p><strong>Setup 2:</strong>  <em>Pure NER over 15 classes</em>, alternatively over 10 classes by removing the B target for non-overlapping classes.<br>\n<strong>Backbone:</strong> 5 folds Deberta Large + 5 folds Deberta xLarge  (maxlen = 1024, stride during inference,  positinon_biased_inputs=False), trained 5 epochs<br>\n<strong>Scheduler:</strong> Polynomial decay  with 10% warmup<br>\n<strong>Optimizer:</strong> AdamW<br>\n<strong>Loss:</strong>  Cross-Entropy (no weights over classes)</p>\n<h2>Validation strategy</h2>\n<p>We used same validation strategy as the one shared by Abishek we also use an enhanced version of the clustesr made by cdeotte to make our MultilabelStratifiedKFold.<br>\nThese folds were really stable and CV to LB correlation was great.</p>\n<h2>Post-processing and ensembling models &amp; boxes</h2>\n<p>As cdeotte’s team, we make use of WBF on our final solutions. WBF was very effective and was the main ingredient behind our spectacular jump in the final days of the competition. Take a look on this tab for further details about CV / LB.</p>\n<p><img src=\"https://i.ibb.co/Ntx57Gz/image.png\" alt=\"cv/lb before and after wbf\"></p>\n<h2>What works</h2>\n<ul>\n<li>Filtering on num_tokens and score</li>\n<li>Smart boxe ensembling (WBF)</li>\n<li>Random Masking</li>\n<li>Random  start (if not striding during training)</li>\n<li>Small batch size</li>\n<li>Small learning rates</li>\n</ul>\n<h2>What doesn’t work</h2>\n<ul>\n<li>Training on longer sequences</li>\n<li>Training long text aware models : LongFormer, Funnel and BigBird wasn’t better than deberta-v1 for us.</li>\n<li>More epochs, higher batch size</li>\n<li>Training on cleaned data</li>\n<li>Using better word splitter than python split</li>\n<li>QA instead of NER</li>\n<li>Simply bagging models by averaging word level scores</li>\n</ul>\n<h2>Final thoughts</h2>\n<ul>\n<li><p><strong>Training on 10 labels</strong><br>\nWe saw in <a href=\"https://www.kaggle.com/ibrezmohd/feedback-price-eda-markov-transition-matrix\" target=\"_blank\">this kernel</a>'s markov transition matrix that some <em>discourse_types</em> never overlap so we decide to use B-I-O only on Claim and Evidence and binary target for others.</p></li>\n<li><p><strong>positinon_biased_inputs = False</strong><br>\nThe HuggingFace Debrta-v1 version has positinon_biased_inputs parameter set to False by default, so Deberta-v1 is not using global position information by default. We manage to turn global position ON but the perfs are not much better than the vanilla one. Furthermore, turning positinon_biased_inputs OFF allows to use maxlen above 512 without the need to resize the embedding layers.</p></li>\n</ul>\n<p>Thanks for reading our solution.</p>\n<h3>Edit</h3>\n<ul>\n<li><strong>Setup 1 source code</strong>: <a href=\"https://github.com/neroksi/fprize_final_cleanup\" target=\"_blank\">https://github.com/neroksi/fprize_final_cleanup</a></li>\n<li><strong>Setup 2 source code</strong>: <a href=\"https://github.com/crodoc/feedback-prize\" target=\"_blank\">https://github.com/crodoc/feedback-prize</a></li>\n</ul>",
      "rawMarkdown": "First of all, many thanks to the Kaggle team and Feedback Prize team for hosting this competition, and congrats to all winners ! Thanks to my teammates too, namely @amedprof and @crodoc for their hard work and commitment during all those 3 laborious months.\n\n## At the  beginning\nWe struggle a lot during this comp’. We spent almost 2 months far from the bronze zone because our strategy was the exploration one. In fact, a great kernel was published by Abishek at the early beginning of the comp’ and one could just stick to it and keep tuning its hyperparameters to get a decent score (silver zone). But, we didn’t go that way and we kept exploring many ideas.\n\n\n## Solution approach\nIt seems like the go-to approach here is NER. We didn’t reinvent the wheel, we went that way as well since it seems straightfull and answers the problem quite correctly. In fact, we tested some QA approaches but not only were they too slow (training and much more inference) but they had slightly lower scores than our NER approaches. \n\n\n**Setup 1:**  *siblings NER & Span Segmentation*\nWe use a multitask approach to output the segmentation scores (multiclass classification on 3 different values: 0 for background, 1 when inside any entity and 2 for beginning) and the entity scores (15 classes). We still use 15 classes for the NER as well but before computing the class, we convert B-eginning tokens into I-nside.\n\n**Backbone:** 5 folds Deberta-v1 Large + 5 folds Deberta-v1 xLarge  (maxlen = 1024, stride during inference, positinon_biased_inputs=False), trained 5 epochs\n**Scheduler:** Cosine Annealing with no warmup\n**Optimizer:** AdamW\n**Loss:**  Cross-Entropy with dynamic cosine-based class weights. In fact we overweight rare classes (Rebuttal and Counterclaim) by starting with high values and converge to 1 on final epochs.\n\n**Setup 2:**  *Pure NER over 15 classes*, alternatively over 10 classes by removing the B target for non-overlapping classes.\n**Backbone:** 5 folds Deberta Large + 5 folds Deberta xLarge  (maxlen = 1024, stride during inference,  positinon_biased_inputs=False), trained 5 epochs\n**Scheduler:** Polynomial decay  with 10% warmup\n**Optimizer:** AdamW\n**Loss:**  Cross-Entropy (no weights over classes)\n\n\n## Validation strategy\nWe used same validation strategy as the one shared by Abishek we also use an enhanced version of the clustesr made by cdeotte to make our MultilabelStratifiedKFold.\nThese folds were really stable and CV to LB correlation was great.\n\n## Post-processing and ensembling models & boxes\nAs cdeotte’s team, we make use of WBF on our final solutions. WBF was very effective and was the main ingredient behind our spectacular jump in the final days of the competition. Take a look on this tab for further details about CV / LB.\n\n![cv/lb before and after wbf](https://i.ibb.co/Ntx57Gz/image.png)\n\n\n## What works\n* Filtering on num_tokens and score\n* Smart boxe ensembling (WBF)\n* Random Masking\n* Random  start (if not striding during training)\n* Small batch size\n* Small learning rates\n\n## What doesn’t work\n* Training on longer sequences\n* Training long text aware models : LongFormer, Funnel and BigBird wasn’t better than deberta-v1 for us.\n* More epochs, higher batch size\n* Training on cleaned data\n* Using better word splitter than python split\n* QA instead of NER\n* Simply bagging models by averaging word level scores\n\n\n## Final thoughts\n\n* **Training on 10 labels**\nWe saw in [this kernel](https://www.kaggle.com/ibrezmohd/feedback-price-eda-markov-transition-matrix)'s markov transition matrix that some *discourse_types* never overlap so we decide to use B-I-O only on Claim and Evidence and binary target for others.\n\n* **positinon_biased_inputs = False**\nThe HuggingFace Debrta-v1 version has positinon_biased_inputs parameter set to False by default, so Deberta-v1 is not using global position information by default. We manage to turn global position ON but the perfs are not much better than the vanilla one. Furthermore, turning positinon_biased_inputs OFF allows to use maxlen above 512 without the need to resize the embedding layers.\n\n\nThanks for reading our solution.\n\n\n### Edit\n* **Setup 1 source code**: https://github.com/neroksi/fprize_final_cleanup\n* **Setup 2 source code**: https://github.com/crodoc/feedback-prize",
      "votes": 42
    },
    {
      "id": 1725706,
      "postDate": "2022-03-17T10:56:54.170Z",
      "content": "<p>Congrats on 5th place and prize money <a href=\"https://www.kaggle.com/kneroma\" target=\"_blank\">@kneroma</a> <a href=\"https://www.kaggle.com/amedprof\" target=\"_blank\">@amedprof</a> and <a href=\"https://www.kaggle.com/crodoc\" target=\"_blank\">@crodoc</a>. Your team has big jumps in the last days, good job! </p>",
      "rawMarkdown": "Congrats on 5th place and prize money @kneroma @amedprof and @crodoc. Your team has big jumps in the last days, good job! ",
      "votes": 7,
      "replies": [
        {
          "id": 1725863,
          "postDate": "2022-03-17T13:40:26.130Z",
          "content": "<p>Thank you <a href=\"https://www.kaggle.com/duykhanh99\" target=\"_blank\">@duykhanh99</a>. Did you see <a href=\"https://www.kaggle.com/tascj0\" target=\"_blank\">@tascj0</a>? This guy is just WOW! I am always amazed when someone gets such a good results with so little submissions. Just awesome.</p>",
          "rawMarkdown": "Thank you @duykhanh99. Did you see @tascj0? This guy is just WOW! I am always amazed when someone gets such a good results with so little submissions. Just awesome.",
          "votes": 2
        },
        {
          "id": 1725945,
          "postDate": "2022-03-17T14:31:31.777Z",
          "content": "<p>He is outlier :))</p>",
          "rawMarkdown": "He is outlier :))",
          "votes": 6
        },
        {
          "id": 1726016,
          "postDate": "2022-03-17T15:25:38.127Z",
          "content": "<p>Thanks <a href=\"https://www.kaggle.com/duykhanh99\" target=\"_blank\">@duykhanh99</a> </p>",
          "rawMarkdown": "Thanks @duykhanh99 ",
          "votes": 1
        }
      ]
    },
    {
      "id": 1725958,
      "postDate": "2022-03-17T14:39:29.960Z",
      "content": "<p>Thanks for sharing, better decode(GBDT sentence classification, WBF ensemble, Yolo like span detection, beam search) is the key for being on the top!</p>",
      "rawMarkdown": "Thanks for sharing, better decode(GBDT sentence classification, WBF ensemble, Yolo like span detection, beam search) is the key for being on the top!",
      "votes": 2,
      "replies": [
        {
          "id": 1726019,
          "postDate": "2022-03-17T15:27:03.700Z",
          "content": "<p>Yes ! Second stage modeling has been very important in this comp'. Relying only on the direct output of the transformer model seems to be not enough.</p>",
          "rawMarkdown": "Yes ! Second stage modeling has been very important in this comp'. Relying only on the direct output of the transformer model seems to be not enough.",
          "votes": 1
        },
        {
          "id": 1726048,
          "postDate": "2022-03-17T15:55:47.627Z",
          "content": "<p>en, loss function we try to optimize has big gap with final f1:)</p>",
          "rawMarkdown": "en, loss function we try to optimize has big gap with final f1:)"
        }
      ]
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-19T12:37:40Z",
  "competition_id": 31779,
  "competition_slug": "feedback-prize-2021",
  "team_id": 7886310,
  "solution_url": "/competitions/feedback-prize-2021/writeups/now-you-see-me-5-th-place-simultaneous-span-segmen"
}