{
  "id": 72848,
  "title": "Save insincere questions to a txt file",
  "url": "/competitions/quora-insincere-questions-classification/discussion/72848",
  "author_name": "Ane",
  "post_date": "2018-11-27T18:28:26.264000",
  "votes": 3,
  "comment_count": 0,
  "views": 0,
  "content": "<p>Regarding such an abstract concept such as \"sincere\" vs \"insincere\" questions, I believe it's interesting to analyze the questions in detail. I managed to save all insincere questions to a text file to go through them more comfortably. In case anyone might find it useful, here is the code:</p>\n\n<pre><code>insincere_questions = train[train[\"target\"] == 1][\"question_text\"].tolist()\n\nwith open('insincere_questions.txt', 'w') as f:\n    for item in insincere_questions:\n        f.write(\"%s\\n\" % item)\n</code></pre>\n\n<p>Make sure you haven't popped the <code>target</code> column before doing this! Then commit the kernel and you'll find the txt file in the Output tab.</p>",
  "messages": [
    {
      "id": 428701,
      "postDate": "2018-11-27T18:28:26.263Z",
      "content": "<p>Regarding such an abstract concept such as \"sincere\" vs \"insincere\" questions, I believe it's interesting to analyze the questions in detail. I managed to save all insincere questions to a text file to go through them more comfortably. In case anyone might find it useful, here is the code:</p>\n\n<pre><code>insincere_questions = train[train[\"target\"] == 1][\"question_text\"].tolist()\n\nwith open('insincere_questions.txt', 'w') as f:\n    for item in insincere_questions:\n        f.write(\"%s\\n\" % item)\n</code></pre>\n\n<p>Make sure you haven't popped the <code>target</code> column before doing this! Then commit the kernel and you'll find the txt file in the Output tab.</p>",
      "rawMarkdown": "Regarding such an abstract concept such as \"sincere\" vs \"insincere\" questions, I believe it's interesting to analyze the questions in detail. I managed to save all insincere questions to a text file to go through them more comfortably. In case anyone might find it useful, here is the code:\n\n    insincere_questions = train[train[\"target\"] == 1][\"question_text\"].tolist()\n\n    with open('insincere_questions.txt', 'w') as f:\n        for item in insincere_questions:\n            f.write(\"%s\\n\" % item)\n\nMake sure you haven't popped the `target` column before doing this! Then commit the kernel and you'll find the txt file in the Output tab.",
      "votes": 3
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "428701": "Regarding such an abstract concept such as \"sincere\" vs \"insincere\" questions, I believe it's interesting to analyze the questions in detail. I managed to save all insincere questions to a text file to go through them more comfortably. In case anyone might find it useful, here is the code:\n\n    insincere_questions = train[train[\"target\"] == 1][\"question_text\"].tolist()\n\n    with open('insincere_questions.txt', 'w') as f:\n        for item in insincere_questions:\n            f.write(\"%s\\n\" % item)\n\nMake sure you haven't popped the `target` column before doing this! Then commit the kernel and you'll find the txt file in the Output tab."
  }
}