{
  "id": 2446,
  "title": "Text representation",
  "url": "/competitions/predict-closed-questions-on-stack-overflow/discussion/2446",
  "author_name": "",
  "post_date": "2012-08-26T16:01:19.423Z",
  "votes": null,
  "comment_count": 4,
  "views": 2554,
  "content": "Hi, I am used to appling ML algorithms on numbers, but never with words. Is there a way to represent text as numbers? thanks",
  "messages": [
    {
      "id": "13476",
      "postDate": "08/26/2012 16:01:19",
      "content": "Hi, I am used to appling ML algorithms on numbers, but never with words. Is there a way to represent text as numbers? thanks",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "13492",
      "postDate": "08/27/2012 05:12:58",
      "content": "<p>[quote=Mariam;13476]</p>\r\n<p>Hi, I am used to appling ML algorithms on numbers, but never with words. Is there a way to represent text as numbers? thanks</p>\r\n<p>[/quote]There's many ways to represent text numerically that have been studied in\r\n<a href=\"http://en.wikipedia.org/wiki/Natural_language_processing\">natural language processing</a>. One basic model is the\r\n<a href=\"http://en.wikipedia.org/wiki/Bag-of-words_model\">bag of words</a>, where a document is represented as a vector of counts of word occurences (this ignores word order, but works surprisingly well for many applications). Dan Jurafsky and Chris Manning's\r\n<a href=\"https://www.coursera.org/course/nlp\">coursera course</a> provides an excellent introduction to NLP as well.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "13496",
      "postDate": "08/27/2012 06:06:37",
      "content": "<p>Thanks. That's exactly what I was looking for: the technical terms and a coursera course.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "13508",
      "postDate": "08/27/2012 15:14:38",
      "content": "<p>Thanks for the reference to that coursera course.&nbsp; Andrew Ng also covers the word vector briefly in the Machine Learning course (https://class.coursera.org/ml-2012-002/class/index), but it's only one exercise (email span classification) and very late into\r\n the class.&nbsp; It would be nice to take an entire course on NLP.&nbsp; I'm adding that to my &quot;next classes to take&quot; list :)</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "13536",
      "postDate": "08/27/2012 23:22:57",
      "content": "<p>I'm pretty sure that assigning a different prime number to each unique word, multiplying combiniations of words, and then using some kind of analytical engine to perform math on them it the correct approach ;-)</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 13492,
      "author_name": "benhamner",
      "author_url": "",
      "post_date": "08/27/2012 05:12:58",
      "content": "<p>[quote=Mariam;13476]</p>\r\n<p>Hi, I am used to appling ML algorithms on numbers, but never with words. Is there a way to represent text as numbers? thanks</p>\r\n<p>[/quote]There's many ways to represent text numerically that have been studied in\r\n<a href=\"http://en.wikipedia.org/wiki/Natural_language_processing\">natural language processing</a>. One basic model is the\r\n<a href=\"http://en.wikipedia.org/wiki/Bag-of-words_model\">bag of words</a>, where a document is represented as a vector of counts of word occurences (this ignores word order, but works surprisingly well for many applications). Dan Jurafsky and Chris Manning's\r\n<a href=\"https://www.coursera.org/course/nlp\">coursera course</a> provides an excellent introduction to NLP as well.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 13496,
      "author_name": "mariam",
      "author_url": "",
      "post_date": "08/27/2012 06:06:37",
      "content": "<p>Thanks. That's exactly what I was looking for: the technical terms and a coursera course.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 13508,
      "author_name": "mcstar",
      "author_url": "",
      "post_date": "08/27/2012 15:14:38",
      "content": "<p>Thanks for the reference to that coursera course.&nbsp; Andrew Ng also covers the word vector briefly in the Machine Learning course (https://class.coursera.org/ml-2012-002/class/index), but it's only one exercise (email span classification) and very late into\r\n the class.&nbsp; It would be nice to take an entire course on NLP.&nbsp; I'm adding that to my &quot;next classes to take&quot; list :)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 13536,
      "author_name": "micahjc",
      "author_url": "",
      "post_date": "08/27/2012 23:22:57",
      "content": "<p>I'm pretty sure that assigning a different prime number to each unique word, multiplying combiniations of words, and then using some kind of analytical engine to perform math on them it the correct approach ;-)</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "13476": "",
    "13492": "",
    "13496": "",
    "13508": "",
    "13536": ""
  },
  "source": "meta"
}