Algorithm for matching similar content text items

I am working on a website (C#, ASP.Net MVC 3) which reads some RSS feeds from multiple sources and put feed title and summary in a database table(Sql Server).

What I want to do is:
Put an algorithm in place which can relate multiple feeds. For example if each feed is a news item, I would like to relate all news which says in different grammar of English “Some has won some election”.

Is there any standard algorithm for such kind of content matching logic?
If not, what kind of custom algorithm should be used?

If this logic can be written on Database side(e.g. Stored Procedure) it will be better.

1

As @Cosmin-Prund said, there’s no trivial or good pre-existing way to do this. My off-the-top-of-my-head suggestion would be to use a search engine like Lucene to tokenize and store the feed title. Use a stemming tokenizer, so that you can match words even if they’re in different forms (such as wins vs winning). Then, when you process a new feed, you can search for the title as keywords, and see what you get back. You’ll have to play with it some to find out how to tune the results to do what you want (try dropping the two most common tokens?), but it ought to be in the right ballpark of what you’re looking for.

I’ve actually been looking into doing something similar. As a good starting point, I found an open source project called mahout which implements most of the algorithms you need, although it is far from a plug and play solution.

The three use cases you might be interested in are clustering, recommendation, and classification. They all basically group items into related topics, but in subtly different ways.

  • Use recommendation when you have a bunch of news articles and are trying to determine which ones you are most likely to like based on your past reading habits and those of readers similar to you.
  • Use classification when you want to group the news articles into subjects, and you know beforehand what those subjects should be. This is most useful for long term, ongoing topics, like the weather, for example.
  • Use clustering when you want to group the news articles into basic subjects, and you don’t know beforehand what those subjects should be. This is most useful for one-time events, like the death of Hugo Chavez, for example.

If you’re looking for a more complete solution, check out Carrot2. It is only able to handle around 1,000 documents, though. Perhaps useful if you are only interested in clustering one day’s worth of news from a few select rss feeds.

I’ve used an approach based on Levenshtein distance to find similar phrases and words. It doesn’t understand semantics, but it’s used to find a concrete number telling “how similar are these two phrases”. The algorithm itself are quick and easy and I know it’s implemented in a few databases as well.

1

On the Database side, the Postgresql database engine, since version 8.3, has the feature: Fuzzy String Match

It “provides several functions to determine similarities and distance between strings.”

I suppose you can take a minhash based near duplication detection approach since the text is relatively long (considering the content). There’s a good article here

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật