Categorizing Words and Category Values

前端 未结 21 1586
温柔的废话
温柔的废话 2021-01-31 05:49

We were set an algorithm problem in class today, as a \"if you figure out a solution you don\'t have to do this subject\". SO of course, we all thought we will give it a go.

相关标签:
21条回答
  • 2021-01-31 06:31

    Use an existing categorized large data set such as RCV1 to train your system of choice. You could do worse then to start reading existing research and benchmarks.

    Appart from Google there exist other 'encyclopedic" datasets you can build of, some of them hosted as public data sets on Amazon Web Services, such as a complete snapshot of the English language Wikipedia.

    Be creative. There is other data out there besides Google.

    0 讨论(0)
  • 2021-01-31 06:32

    Maybe you are all making this too hard.

    Obviously, you need an external reference of some sort to rank the probability that X is in category Y. Is it possible that he's testing your "out of the box" thinking and that YOU could be the external reference? That is, the algorithm is a simple matter of running through each category and each word and asking YOU (or whoever sits at the terminal) whether word X is in the displayed category Y. There are a few simple variations on this theme but they all involve blowing past the Gordian knot by simply cutting it.

    Or not...depends on the teacher.

    0 讨论(0)
  • 2021-01-31 06:32

    So it seems you have a couple options here, but for the most part I think if you want accurate data you are going to need to use some outside help. Two options that I can think of would be to make use of a dictionary search, or crowd sourcing.

    In regards to a dictionary search, you could just go through the database, query it and parse the results to see if one of the category names is displayed on the page. For example, if you search "red" you will find "color" on the page and likewise, searching for "fishing" returns "sport" on the page.

    Another, slightly more outside the box option would be to make use of crowd sourcing, consider the following:

    1. Start by more or less randomly assigning name-value pairs.
    2. Output the results.
    3. Load the results up on Amazon Mechanical Turk (AMT) to get feedback from humans on how well the pairs work.
    4. Input the results of the AMT evaluation back into the system along with the random assignments.
    5. If everything was approved, then we are done.
    6. Otherwise, retain the correct hits and process them to see if any pattern can be established, generate a new set of name-value pairs.
    7. Return to step 3.

    Granted this would entail some financial outlay, but it might also be one of the simplest and accurate versions of the data you are going get on a fairly easy basis.

    0 讨论(0)
  • 2021-01-31 06:32

    My first thought would be to leverage external data. Write a program that google-searches each word, and takes the 'category' that appears first/highest in the search results :)

    That might be considered cheating, though.

    0 讨论(0)
  • 2021-01-31 06:34

    I am assuming that the problem allows using external data, because otherwise I cannot conceive of a way to deduce the meaning from words algorithmically.

    Maybe something could be done with a thesaurus database, and looking for minimal distances between 'word' words and 'category' words?

    0 讨论(0)
  • 2021-01-31 06:34

    Well, you can't use Google, but you CAN use Yahoo, Ask, Bing, Ding, Dong, Kong... I would do a few passes. First query the 100 words against 2-3 search engines, grab the first y resulting articles (y being a threshold to experiment with. 5 is a good start I think) and scan the text. In particular I"ll search for the 10 categories. If a category appears more than x time (x again being some threshold you need to experiment with) its a match. Based on that x threshold (ie how many times a category appears in the text) and how may of the top y pages it appears in you can assign a weigh to a word-category pair. for better accuracy you can then do another pass with those non-google search engines with the word-category pair (with a AND relationship) and apply the number of resulting pages to the weight of that pair. Them simply assume the word-category pair with highest weight is the right one (assuming you'll even have more than one option). You can also multi assign a word to a multiple category if the weights are close enough (z threshold maybe). Based on that you can introduce any number of words and any number of categories. And You'll win your challenge. I also think this method is good to evaluate the weight of potential adwords in advertising. but that's another topic....

    Good luck

    Harel

    0 讨论(0)
提交回复
热议问题