tags:

views:

340

answers:

5

Hi, we often see 'related items'. For instance in blogs we have related posts, in books we have related books, etc. My question is how do we compile those relevency? If it's just tag, I often see related items that does not have the same tag. For instance, when search for 'pink', a related item could have a 'purple' tag.

Anyone has any idea?

+1  A: 

It can be more than a tag, for example it can be average of each work appearing in a paragraph, and then titles, etc

Sarfraz
A: 

it can also be based on "people who bought this book also bought"

No matter how, you will need some dort of connection between your items, and they will mostly be made by human beings

Natrium
+6  A: 

There are many ways to calculate similarity of two items, but for a straightforward method, take a look at the Jaccard Coefficient.

http://en.wikipedia.org/wiki/Jaccard_index

Which is: J(a,b) = intersection(a,b)/union(a,b)

So lets say you want to compute the coefficient of two items:

Item A, which has the tags  "books, school, pencil, textbook, reading"
Item B, which has the tags  "books, reading, autobiography"

intersection(A,B) = books, reading
union(A,B) = books, school, pencil, textbook, reading, autobiography

so J(a,b) = 2/6 = .333

So the most related item to A would be the item which results in the highest Jaccard Coefficient when paired with A.
sfrench
+2  A: 

Here are some of the ways:

  1. Manually connecting them. Put up a table with the fields item_id and related_item_id, then make an interface to insert the connections. Useful to relate two items that are related but have no resemblance or do not belong to the same category/tag (or in an uncategorized entry table). Example: Bath tub and rubber ducky
  2. Pull up some items that belong to the same category or have a similar tag. The idea is that those items must be somewhat related since they are in the same category. Example: in the page viewing LCD monitors, there are random LCD monitors (with same price range/manufacturer/resolution) in the "Related items" section.
  3. Do a text search matching current item's name (and or description) against other items in the table. You get the idea.
andyk
A: 

I would say they use ontology for that which adds more great features to the application.

Bakhtiyor