{
  "id": 130076,
  "title": "26 place solution",
  "content": "<p>Congrats to all winners! And thanks to organizers!\nThe competition was very very difficult for me, but fortunately I got 26th place.\nI share my gotten knowledge.</p>\n\n<h3>modeling</h3>\n\n<p>I used a huggingface transformer and customized the head of the model.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1483555%2F7d88db1391baa10f5ce96f74490d2bd1%2F1.png?generation=1581475630913742&amp;alt=media\" alt=\"\"></p>\n\n<p>As you know, I imitated the first solution of the <a href=\"https://www.kaggle.com/c/jigsaw-unintended-bias-in-toxicity-classification/discussion/103280\">jigsaw</a>.</p>\n\n<p>BERT-base-cased, BERT-base-uncased and XLNet-base-case with this header were weighted at 2:4:4.</p>\n\n<h3>Parameter</h3>\n\n<ul>\n<li>10 GroupFold</li>\n<li>epoch: 3</li>\n<li>batch size: 8</li>\n<li>optimizer: AdamW\n<ul><li>OneCycleLR</li>\n<li>max_lr=5e-5 (decay*0.9)</li></ul></li>\n<li>loss: BCE + MSE(MSE weighted by label frequency)</li>\n</ul>\n\n<h3>Token</h3>\n\n<p>I add category token. like  below;</p>\n\n<p><code>\n[CLS] [CATEGORY_TOKEN] question_title [SEP] question_body [SEP] ansewr [SEP]\n</code>\nIt raised 0.05 my CV.</p>\n\n<h3>Optimize binning</h3>\n\n<p>I read <a href=\"https://www.kaggle.com/c/google-quest-challenge/discussion/119177\">this Discussion</a>.\nI calculated the common denominator and binned the predicted values.\nOptimized binning with features like <a href=\"https://www.kaggle.com/c/petfinder-adoption-prediction/discussion/76107\">OptimizeRounder</a>.</p>\n\n<h3>not work for me</h3>\n\n<ul>\n<li>pseudo label</li>\n<li>MultiSample Dropout</li>\n<li>SWA</li>\n<li>AdaBound</li>\n<li>FocalLoss</li>\n<li>RoBERTa, ALBERT</li>\n<li>Prediction with Special Token for each target</li>\n</ul>\n\n<h3>my code</h3>\n\n<ul>\n<li>train: <a href=\"https://github.com/trtd56/KaggleQuest\">https://github.com/trtd56/KaggleQuest</a></li>\n<li>predict : <a href=\"https://www.kaggle.com/takamichitoda/26th-place-solution?scriptVersionId=28524791\">https://www.kaggle.com/takamichitoda/26th-place-solution?scriptVersionId=28524791</a></li>\n</ul>\n\n<p>Thank you!!</p>",
  "comments": [
    {
      "id": 744216,
      "author_name": "YaGana Sheriff-Hussaini",
      "author_url": "",
      "post_date": "2020-02-12T16:59:18.170000",
      "content": "<p>Congrats <a href=\"/takamichitoda\">@takamichitoda</a>  and thanks for sharing your code.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 743638,
      "author_name": "Ailurophile",
      "author_url": "",
      "post_date": "2020-02-12T06:45:26.110000",
      "content": "<p>Congratulations!\nThanks for Sharing your Approach &amp; Insights!! <a href=\"/takamichitoda\">@takamichitoda</a> </p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 743461,
      "author_name": "Aditya Soni",
      "author_url": "",
      "post_date": "2020-02-12T04:40:14.563000",
      "content": "<p>When we added Domain Categories, it didn't help at all :(</p>",
      "votes": 1,
      "replies": [
        {
          "id": 743663,
          "author_name": "Takamichi Toda",
          "author_url": "",
          "post_date": "2020-02-12T07:08:53.003000",
          "content": "<p>Oh, really? In my case, all three model improves when add category.\nI can't explain it, sorry...</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 743449,
      "author_name": "Chris Deotte",
      "author_url": "",
      "post_date": "2020-02-12T04:20:30.397000",
      "content": "<p>Great job. Creative model. Adding a category token was very clever. Inputting category early in the model allows all hidden layers to pay attention to it. Can you explain the steps to add a custom token?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 743451,
          "author_name": "Nirjhar Roy",
          "author_url": "",
          "post_date": "2020-02-12T04:25:21.920000",
          "content": "<p>I think its here : \n<a href=\"https://github.com/trtd56/KaggleQuest/blob/master/work/Quest_BERT-train.ipynb\">https://github.com/trtd56/KaggleQuest/blob/master/work/Quest_BERT-train.ipynb</a></p>\n\n<p>```\ntokenizer = tokenizer_class.from_pretrained(pretrained_weights)</p>\n\n<p>categories = train[\"category\"].unique().tolist()\ncategories = [f\"[{c}]\" for c in categories]\ntokenizer.add_tokens(categories)</p>\n\n<p>tokenizer.added_tokens_encoder\n```</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 743455,
          "author_name": "Chris Deotte",
          "author_url": "",
          "post_date": "2020-02-12T04:29:35.120000",
          "content": "<p>Wow awesome.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 743439,
      "author_name": "Gerwyn",
      "author_url": "",
      "post_date": "2020-02-12T04:07:50.843000",
      "content": "<p>Congrats and thanks for the write up!! :)</p>\n\n<p>May i ask how much difference in CV for your xlnet/bert cased vs bert base uncased? </p>",
      "votes": 1,
      "replies": [
        {
          "id": 743459,
          "author_name": "Takamichi Toda",
          "author_url": "",
          "post_date": "2020-02-12T04:35:03.570000",
          "content": "<p>My CV is that:\n- BERT-uncased: 0.4109153513\n- BERT-cased:0.4047241234\n- XLNet-cased:0.407151191</p>\n\n<p>and tried mix result is:\n|BERT-uncased|BERT-cased|XLNet-cased|CV|\n| -- | -- | -- | -- |\n|0.3|0.3|0.3|0.421838540812048|\n|0.5|0.2|0.3|0.42176727179908|\n|0.4|0.2|0.4|0.422223424005272|</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 743478,
          "author_name": "Gerwyn",
          "author_url": "",
          "post_date": "2020-02-12T05:17:12.563000",
          "content": "<p>wow thanks for the details! </p>\n\n<p>I also can't beat my bert base uncased baseline with cased and xlnet version too </p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 744000,
      "author_name": "Nandhu Elango",
      "author_url": "",
      "post_date": "2020-02-12T13:17:11.973000",
      "content": "<p>Very nice and clean code for better understanding👍 </p>",
      "votes": 0,
      "replies": []
    }
  ],
  "comment_count": 11,
  "messages": [
    {
      "id": 743394,
      "postDate": "2020-02-12T02:55:53.030Z",
      "content": "<p>Congrats to all winners! And thanks to organizers!\nThe competition was very very difficult for me, but fortunately I got 26th place.\nI share my gotten knowledge.</p>\n\n<h3>modeling</h3>\n\n<p>I used a huggingface transformer and customized the head of the model.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1483555%2F7d88db1391baa10f5ce96f74490d2bd1%2F1.png?generation=1581475630913742&amp;alt=media\" alt=\"\"></p>\n\n<p>As you know, I imitated the first solution of the <a href=\"https://www.kaggle.com/c/jigsaw-unintended-bias-in-toxicity-classification/discussion/103280\">jigsaw</a>.</p>\n\n<p>BERT-base-cased, BERT-base-uncased and XLNet-base-case with this header were weighted at 2:4:4.</p>\n\n<h3>Parameter</h3>\n\n<ul>\n<li>10 GroupFold</li>\n<li>epoch: 3</li>\n<li>batch size: 8</li>\n<li>optimizer: AdamW\n<ul><li>OneCycleLR</li>\n<li>max_lr=5e-5 (decay*0.9)</li></ul></li>\n<li>loss: BCE + MSE(MSE weighted by label frequency)</li>\n</ul>\n\n<h3>Token</h3>\n\n<p>I add category token. like  below;</p>\n\n<p><code>\n[CLS] [CATEGORY_TOKEN] question_title [SEP] question_body [SEP] ansewr [SEP]\n</code>\nIt raised 0.05 my CV.</p>\n\n<h3>Optimize binning</h3>\n\n<p>I read <a href=\"https://www.kaggle.com/c/google-quest-challenge/discussion/119177\">this Discussion</a>.\nI calculated the common denominator and binned the predicted values.\nOptimized binning with features like <a href=\"https://www.kaggle.com/c/petfinder-adoption-prediction/discussion/76107\">OptimizeRounder</a>.</p>\n\n<h3>not work for me</h3>\n\n<ul>\n<li>pseudo label</li>\n<li>MultiSample Dropout</li>\n<li>SWA</li>\n<li>AdaBound</li>\n<li>FocalLoss</li>\n<li>RoBERTa, ALBERT</li>\n<li>Prediction with Special Token for each target</li>\n</ul>\n\n<h3>my code</h3>\n\n<ul>\n<li>train: <a href=\"https://github.com/trtd56/KaggleQuest\">https://github.com/trtd56/KaggleQuest</a></li>\n<li>predict : <a href=\"https://www.kaggle.com/takamichitoda/26th-place-solution?scriptVersionId=28524791\">https://www.kaggle.com/takamichitoda/26th-place-solution?scriptVersionId=28524791</a></li>\n</ul>\n\n<p>Thank you!!</p>",
      "rawMarkdown": "Congrats to all winners! And thanks to organizers!\nThe competition was very very difficult for me, but fortunately I got 26th place.\nI share my gotten knowledge.\n\n### modeling\n\nI used a huggingface transformer and customized the head of the model.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1483555%2F7d88db1391baa10f5ce96f74490d2bd1%2F1.png?generation=1581475630913742&amp;alt=media)\n\n\nAs you know, I imitated the first solution of the [jigsaw](https://www.kaggle.com/c/jigsaw-unintended-bias-in-toxicity-classification/discussion/103280).\n\nBERT-base-cased, BERT-base-uncased and XLNet-base-case with this header were weighted at 2:4:4.\n\n### Parameter\n\n- 10 GroupFold\n- epoch: 3\n- batch size: 8\n- optimizer: AdamW\n  - OneCycleLR\n  - max_lr=5e-5 (decay*0.9)\n- loss: BCE + MSE(MSE weighted by label frequency)\n\n### Token\n\nI add category token. like  below;\n\n```\n[CLS] [CATEGORY_TOKEN] question_title [SEP] question_body [SEP] ansewr [SEP]\n```\nIt raised 0.05 my CV.\n\n### Optimize binning\n\nI read [this Discussion](https://www.kaggle.com/c/google-quest-challenge/discussion/119177).\nI calculated the common denominator and binned the predicted values.\nOptimized binning with features like [OptimizeRounder](https://www.kaggle.com/c/petfinder-adoption-prediction/discussion/76107).\n\n### not work for me\n- pseudo label\n- MultiSample Dropout\n- SWA\n- AdaBound\n- FocalLoss\n- RoBERTa, ALBERT\n- Prediction with Special Token for each target\n\n### my code\n- train: https://github.com/trtd56/KaggleQuest\n- predict : https://www.kaggle.com/takamichitoda/26th-place-solution?scriptVersionId=28524791\n\nThank you!!",
      "votes": 14
    },
    {
      "id": 744216,
      "postDate": "2020-02-12T16:59:18.170Z",
      "content": "<p>Congrats <a href=\"/takamichitoda\">@takamichitoda</a>  and thanks for sharing your code.</p>",
      "rawMarkdown": "Congrats @takamichitoda  and thanks for sharing your code.",
      "votes": 1
    },
    {
      "id": 743638,
      "postDate": "2020-02-12T06:45:26.110Z",
      "content": "<p>Congratulations!\nThanks for Sharing your Approach &amp; Insights!! <a href=\"/takamichitoda\">@takamichitoda</a> </p>",
      "rawMarkdown": "Congratulations!\nThanks for Sharing your Approach &amp; Insights!! @takamichitoda ",
      "votes": 1
    },
    {
      "id": 743461,
      "postDate": "2020-02-12T04:40:14.563Z",
      "content": "<p>When we added Domain Categories, it didn't help at all :(</p>",
      "rawMarkdown": "When we added Domain Categories, it didn't help at all :(",
      "votes": 1,
      "replies": [
        {
          "id": 743663,
          "postDate": "2020-02-12T07:08:53.003Z",
          "content": "<p>Oh, really? In my case, all three model improves when add category.\nI can't explain it, sorry...</p>",
          "rawMarkdown": "Oh, really? In my case, all three model improves when add category.\nI can't explain it, sorry..."
        }
      ]
    },
    {
      "id": 743449,
      "postDate": "2020-02-12T04:20:30.397Z",
      "content": "<p>Great job. Creative model. Adding a category token was very clever. Inputting category early in the model allows all hidden layers to pay attention to it. Can you explain the steps to add a custom token?</p>",
      "rawMarkdown": "Great job. Creative model. Adding a category token was very clever. Inputting category early in the model allows all hidden layers to pay attention to it. Can you explain the steps to add a custom token?",
      "votes": 1,
      "replies": [
        {
          "id": 743451,
          "postDate": "2020-02-12T04:25:21.920Z",
          "content": "<p>I think its here : \n<a href=\"https://github.com/trtd56/KaggleQuest/blob/master/work/Quest_BERT-train.ipynb\">https://github.com/trtd56/KaggleQuest/blob/master/work/Quest_BERT-train.ipynb</a></p>\n\n<p>```\ntokenizer = tokenizer_class.from_pretrained(pretrained_weights)</p>\n\n<p>categories = train[\"category\"].unique().tolist()\ncategories = [f\"[{c}]\" for c in categories]\ntokenizer.add_tokens(categories)</p>\n\n<p>tokenizer.added_tokens_encoder\n```</p>",
          "rawMarkdown": "I think its here : \nhttps://github.com/trtd56/KaggleQuest/blob/master/work/Quest_BERT-train.ipynb\n\n```\ntokenizer = tokenizer_class.from_pretrained(pretrained_weights)\n\ncategories = train[\"category\"].unique().tolist()\ncategories = [f\"[{c}]\" for c in categories]\ntokenizer.add_tokens(categories)\n\ntokenizer.added_tokens_encoder\n```",
          "votes": 2
        },
        {
          "id": 743455,
          "postDate": "2020-02-12T04:29:35.120Z",
          "content": "<p>Wow awesome.</p>",
          "rawMarkdown": "Wow awesome.",
          "votes": 1
        }
      ]
    },
    {
      "id": 743439,
      "postDate": "2020-02-12T04:07:50.843Z",
      "content": "<p>Congrats and thanks for the write up!! :)</p>\n\n<p>May i ask how much difference in CV for your xlnet/bert cased vs bert base uncased? </p>",
      "rawMarkdown": "Congrats and thanks for the write up!! :)\n\nMay i ask how much difference in CV for your xlnet/bert cased vs bert base uncased? ",
      "votes": 1,
      "replies": [
        {
          "id": 743459,
          "postDate": "2020-02-12T04:35:03.570Z",
          "content": "<p>My CV is that:\n- BERT-uncased: 0.4109153513\n- BERT-cased:0.4047241234\n- XLNet-cased:0.407151191</p>\n\n<p>and tried mix result is:\n|BERT-uncased|BERT-cased|XLNet-cased|CV|\n| -- | -- | -- | -- |\n|0.3|0.3|0.3|0.421838540812048|\n|0.5|0.2|0.3|0.42176727179908|\n|0.4|0.2|0.4|0.422223424005272|</p>",
          "rawMarkdown": "My CV is that:\n- BERT-uncased: 0.4109153513\n- BERT-cased:0.4047241234\n- XLNet-cased:0.407151191\n\nand tried mix result is:\n|BERT-uncased|BERT-cased|XLNet-cased|CV|\n| -- | -- | -- | -- |\n|0.3|0.3|0.3|0.421838540812048|\n|0.5|0.2|0.3|0.42176727179908|\n|0.4|0.2|0.4|0.422223424005272|\n",
          "votes": 1
        },
        {
          "id": 743478,
          "postDate": "2020-02-12T05:17:12.563Z",
          "content": "<p>wow thanks for the details! </p>\n\n<p>I also can't beat my bert base uncased baseline with cased and xlnet version too </p>",
          "rawMarkdown": "wow thanks for the details! \n\nI also can't beat my bert base uncased baseline with cased and xlnet version too ",
          "votes": 1
        }
      ]
    },
    {
      "id": 744000,
      "postDate": "2020-02-12T13:17:11.973Z",
      "content": "<p>Very nice and clean code for better understanding👍 </p>",
      "rawMarkdown": "Very nice and clean code for better understanding👍 "
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-19T19:08:25Z",
  "competition_id": 7968,
  "competition_slug": "google-quest-challenge",
  "team_id": 4015315,
  "solution_url": "/competitions/google-quest-challenge/writeups/takamichi-toda-26-place-solution"
}