{
  "id": 313253,
  "title": "15th Solution",
  "content": "<p>First of all, I would like to thank the excellent notebooks and discussions from <a href=\"https://www.kaggle.com/abhishek/two-longformers-are-better-than-1\" target=\"_blank\">https://www.kaggle.com/abhishek/two-longformers-are-better-than-1</a> <a href=\"https://www.kaggle.com/abhishek\" target=\"_blank\">@abhishek</a> <br>\n<a href=\"https://www.kaggle.com/c/feedback-prize-2021/discussion/308992\" target=\"_blank\">https://www.kaggle.com/c/feedback-prize-2021/discussion/308992</a> <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> <br>\n<a href=\"https://www.kaggle.com/librauee/infer-fast-ensemble-models\" target=\"_blank\">https://www.kaggle.com/librauee/infer-fast-ensemble-models</a> <a href=\"https://www.kaggle.com/librauee\" target=\"_blank\">@librauee</a> <br>\nI learned a lot from their work. This is the second kaggle competition we have participated in, and although we are one short of gold, we are already very satisfied.</p>\n<h3>Models</h3>\n<ul>\n<li>In the final commit, we ensemble 6 debreta_xlarge, 6 longformer-large-4096, 2 funnel-large, 2 deberta-v3-large and 2 deberta-large. We set the max_length to 1600. We use Fast Gradient Method(FGM) to improve robustness and use Exponential Moving Average(EMA) to smooth training.</li>\n<li>Use optuna to learn all the hyperparameters in the post processing stage.</li>\n<li>CV results show that deberta-xlarge(0.7092) &gt; deberta-large(0.7025) &gt; deberta-large-v3(0.6842) &gt; funnel-large(0.6798) = longformer-large-4096(0.6748)</li>\n</ul>\n<h3>Post processing</h3>\n<ul>\n<li><p>Merge consecutive predictions with same label, for example we merge [B-Lead, I-Lead, I-Lead], [B-Lead, I-Lead] into one single prediction. We only do this operation when the label is in ['Lead', 'Position', 'Concluding', 'Rebuttal'], since there are not consecutive predictions for these labels in the training data.</p></li>\n<li><p>Filter \"Lead\" and \"Concluding\". There are only one Lead label and  Concluding Label in almost all the trainging data, so we only keep the predictions that has higher score than threshold. Besides, we found that merge two Lead can increase cv further.</p></li>\n</ul>\n<pre><code>concluding_df = sorted(concluding_df, key=lambda x: np.mean(x[4]), reverse=True)\nnew_begin = min(concluding_df[0][3][0], concluding_df[1][3][0])\nnew_end = max(concluding_df[0][3][-1], concluding_df[1][3][-1])\n</code></pre>\n<ul>\n<li><p>Since the score is based on the overlap between prediction and ground truth, so we extend the predictions from word_list[begin:end] to word_list[begin - 1: end + 1]. Hoping the extended predictions can better hit ground truth and accross the 50% threshold.</p></li>\n<li><p>Scaling. The probabilities of each token are multiplied by a factor. The factors are obtained through genetic algorithm search.</p></li>\n<li><p>There are some other attempts but didn't work well. These attempts are included in the inference notebook.</p></li>\n</ul>\n<h3>Code</h3>\n<ul>\n<li>Inference and Post-processing: <a href=\"https://www.kaggle.com/telmazzzz/fb-inference-0-711-final?scriptVersionId=90185445\" target=\"_blank\">https://www.kaggle.com/telmazzzz/fb-inference-0-711-final?scriptVersionId=90185445</a></li>\n<li>Training: <a href=\"https://github.com/TelmaZzzz/FeedBack\" target=\"_blank\">https://github.com/TelmaZzzz/FeedBack</a></li>\n</ul>",
  "comments": [
    {
      "id": 1724424,
      "author_name": "TelmaZzzz",
      "author_url": "",
      "post_date": "2022-03-16T08:37:19.220000",
      "content": "<p>Next target: gold medal!!!</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1724559,
      "author_name": "GUNER",
      "author_url": "",
      "post_date": "2022-03-16T10:23:35.270000",
      "content": "<p>Congrats on your big win!<br>\nHow did assign the the tokenwise weights in scaling?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 1724562,
          "author_name": "TelmaZzzz",
          "author_url": "",
          "post_date": "2022-03-16T10:27:25.387000",
          "content": "<p>we use optuna to find best weights</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1724534,
      "author_name": "Wonho Song",
      "author_url": "",
      "post_date": "2022-03-16T09:57:27.903000",
      "content": "<p>Thanks for sharing, I enjoy to read ur solution. I think ur cv score from deberta-xlarge is high enough. What is your cv score when u do ensemble?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 1724541,
          "author_name": "TelmaZzzz",
          "author_url": "",
          "post_date": "2022-03-16T10:02:57.957000",
          "content": "<p>Our ensemble model can get 0.715 at fold0 (10 folds) with simple post-processing, and 0.722 can be achieved using the above post-processing</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1724460,
      "author_name": "newbieclass",
      "author_url": "",
      "post_date": "2022-03-16T09:00:48.143000",
      "content": "<p>good job!  </p>",
      "votes": 0,
      "replies": []
    }
  ],
  "comment_count": 6,
  "messages": [
    {
      "id": 1724408,
      "postDate": "2022-03-16T08:28:40.780Z",
      "content": "<p>First of all, I would like to thank the excellent notebooks and discussions from <a href=\"https://www.kaggle.com/abhishek/two-longformers-are-better-than-1\" target=\"_blank\">https://www.kaggle.com/abhishek/two-longformers-are-better-than-1</a> <a href=\"https://www.kaggle.com/abhishek\" target=\"_blank\">@abhishek</a> <br>\n<a href=\"https://www.kaggle.com/c/feedback-prize-2021/discussion/308992\" target=\"_blank\">https://www.kaggle.com/c/feedback-prize-2021/discussion/308992</a> <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> <br>\n<a href=\"https://www.kaggle.com/librauee/infer-fast-ensemble-models\" target=\"_blank\">https://www.kaggle.com/librauee/infer-fast-ensemble-models</a> <a href=\"https://www.kaggle.com/librauee\" target=\"_blank\">@librauee</a> <br>\nI learned a lot from their work. This is the second kaggle competition we have participated in, and although we are one short of gold, we are already very satisfied.</p>\n<h3>Models</h3>\n<ul>\n<li>In the final commit, we ensemble 6 debreta_xlarge, 6 longformer-large-4096, 2 funnel-large, 2 deberta-v3-large and 2 deberta-large. We set the max_length to 1600. We use Fast Gradient Method(FGM) to improve robustness and use Exponential Moving Average(EMA) to smooth training.</li>\n<li>Use optuna to learn all the hyperparameters in the post processing stage.</li>\n<li>CV results show that deberta-xlarge(0.7092) &gt; deberta-large(0.7025) &gt; deberta-large-v3(0.6842) &gt; funnel-large(0.6798) = longformer-large-4096(0.6748)</li>\n</ul>\n<h3>Post processing</h3>\n<ul>\n<li><p>Merge consecutive predictions with same label, for example we merge [B-Lead, I-Lead, I-Lead], [B-Lead, I-Lead] into one single prediction. We only do this operation when the label is in ['Lead', 'Position', 'Concluding', 'Rebuttal'], since there are not consecutive predictions for these labels in the training data.</p></li>\n<li><p>Filter \"Lead\" and \"Concluding\". There are only one Lead label and  Concluding Label in almost all the trainging data, so we only keep the predictions that has higher score than threshold. Besides, we found that merge two Lead can increase cv further.</p></li>\n</ul>\n<pre><code>concluding_df = sorted(concluding_df, key=lambda x: np.mean(x[4]), reverse=True)\nnew_begin = min(concluding_df[0][3][0], concluding_df[1][3][0])\nnew_end = max(concluding_df[0][3][-1], concluding_df[1][3][-1])\n</code></pre>\n<ul>\n<li><p>Since the score is based on the overlap between prediction and ground truth, so we extend the predictions from word_list[begin:end] to word_list[begin - 1: end + 1]. Hoping the extended predictions can better hit ground truth and accross the 50% threshold.</p></li>\n<li><p>Scaling. The probabilities of each token are multiplied by a factor. The factors are obtained through genetic algorithm search.</p></li>\n<li><p>There are some other attempts but didn't work well. These attempts are included in the inference notebook.</p></li>\n</ul>\n<h3>Code</h3>\n<ul>\n<li>Inference and Post-processing: <a href=\"https://www.kaggle.com/telmazzzz/fb-inference-0-711-final?scriptVersionId=90185445\" target=\"_blank\">https://www.kaggle.com/telmazzzz/fb-inference-0-711-final?scriptVersionId=90185445</a></li>\n<li>Training: <a href=\"https://github.com/TelmaZzzz/FeedBack\" target=\"_blank\">https://github.com/TelmaZzzz/FeedBack</a></li>\n</ul>",
      "rawMarkdown": "First of all, I would like to thank the excellent notebooks and discussions from https://www.kaggle.com/abhishek/two-longformers-are-better-than-1 @abhishek \nhttps://www.kaggle.com/c/feedback-prize-2021/discussion/308992 @hengck23 \nhttps://www.kaggle.com/librauee/infer-fast-ensemble-models @librauee \nI learned a lot from their work. This is the second kaggle competition we have participated in, and although we are one short of gold, we are already very satisfied.\n\n### Models\n* In the final commit, we ensemble 6 debreta_xlarge, 6 longformer-large-4096, 2 funnel-large, 2 deberta-v3-large and 2 deberta-large. We set the max_length to 1600. We use Fast Gradient Method(FGM) to improve robustness and use Exponential Moving Average(EMA) to smooth training.\n* Use optuna to learn all the hyperparameters in the post processing stage.\n* CV results show that deberta-xlarge(0.7092) > deberta-large(0.7025) > deberta-large-v3(0.6842) > funnel-large(0.6798) = longformer-large-4096(0.6748)\n\n### Post processing\n* Merge consecutive predictions with same label, for example we merge [B-Lead, I-Lead, I-Lead], [B-Lead, I-Lead] into one single prediction. We only do this operation when the label is in ['Lead', 'Position', 'Concluding', 'Rebuttal'], since there are not consecutive predictions for these labels in the training data.\n\n* Filter \"Lead\" and \"Concluding\". There are only one Lead label and  Concluding Label in almost all the trainging data, so we only keep the predictions that has higher score than threshold. Besides, we found that merge two Lead can increase cv further.\n```python\nconcluding_df = sorted(concluding_df, key=lambda x: np.mean(x[4]), reverse=True)\nnew_begin = min(concluding_df[0][3][0], concluding_df[1][3][0])\nnew_end = max(concluding_df[0][3][-1], concluding_df[1][3][-1])\n```\n\n* Since the score is based on the overlap between prediction and ground truth, so we extend the predictions from word_list[begin:end] to word_list[begin - 1: end + 1]. Hoping the extended predictions can better hit ground truth and accross the 50% threshold.\n\n* Scaling. The probabilities of each token are multiplied by a factor. The factors are obtained through genetic algorithm search.\n\n* There are some other attempts but didn't work well. These attempts are included in the inference notebook.\n\n### Code\n* Inference and Post-processing: https://www.kaggle.com/telmazzzz/fb-inference-0-711-final?scriptVersionId=90185445\n* Training: https://github.com/TelmaZzzz/FeedBack",
      "votes": 20
    },
    {
      "id": 1724424,
      "postDate": "2022-03-16T08:37:19.220Z",
      "content": "<p>Next target: gold medal!!!</p>",
      "rawMarkdown": "Next target: gold medal!!!",
      "votes": 2
    },
    {
      "id": 1724559,
      "postDate": "2022-03-16T10:23:35.270Z",
      "content": "<p>Congrats on your big win!<br>\nHow did assign the the tokenwise weights in scaling?</p>",
      "rawMarkdown": "Congrats on your big win!\nHow did assign the the tokenwise weights in scaling?",
      "replies": [
        {
          "id": 1724562,
          "postDate": "2022-03-16T10:27:25.387Z",
          "content": "<p>we use optuna to find best weights</p>",
          "rawMarkdown": "we use optuna to find best weights",
          "votes": 1
        }
      ]
    },
    {
      "id": 1724534,
      "postDate": "2022-03-16T09:57:27.903Z",
      "content": "<p>Thanks for sharing, I enjoy to read ur solution. I think ur cv score from deberta-xlarge is high enough. What is your cv score when u do ensemble?</p>",
      "rawMarkdown": "Thanks for sharing, I enjoy to read ur solution. I think ur cv score from deberta-xlarge is high enough. What is your cv score when u do ensemble?",
      "replies": [
        {
          "id": 1724541,
          "postDate": "2022-03-16T10:02:57.957Z",
          "content": "<p>Our ensemble model can get 0.715 at fold0 (10 folds) with simple post-processing, and 0.722 can be achieved using the above post-processing</p>",
          "rawMarkdown": "Our ensemble model can get 0.715 at fold0 (10 folds) with simple post-processing, and 0.722 can be achieved using the above post-processing",
          "votes": 1
        }
      ]
    },
    {
      "id": 1724460,
      "postDate": "2022-03-16T09:00:48.143Z",
      "content": "<p>good job!  </p>",
      "rawMarkdown": "good job!  "
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-19T12:35:51Z",
  "competition_id": 31779,
  "competition_slug": "feedback-prize-2021",
  "team_id": 8025185,
  "solution_url": "/competitions/feedback-prize-2021/writeups/15th-solution"
}