Begin forwarded message:

From: borislav popov <[EMAIL PROTECTED]>
Date: October 30, 2008 12:49:48 PM GMT+02:00
To: [EMAIL PROTECTED]
Cc: [email protected]
Subject: Re: [KIM-discussion] Cosine similarity to check web page relevance

Zoran,
        this mail somehow slipped through the support watchdogs.
let's think together on this one:
in the default version of KIM we do not expose anything on ranking / sorting until now. On the other hand we order results in various ways in systems based on KIM and your question is very valid. the DIY approach you apply is actually very nice - one doesn't see very often people trying to dive deeper in how things are being ordered.

anyway i will mention a potential shortcut (although it is much more exciting to continue the way you do it!) if you use the default document store of KIM - it is actually an IR engine - Lucene - and it operates in the way you are trying to model (on various steroids actually :) ) So if you are having an annotation of an entity reference in the document and you have indexed it in KIM then when you search (no matter if keyword-based or semantic search based on what you have in the knowledge base) the doc store will return the documents ordered based on this similarity and you will not need to worry for tf-idf / cosine.

but ! as i say your approach is exciting and also the proposed shortcut is doc store specific - so have it in mind. there are few other tricks on how you can model additional factors to influence the score/order of docs in these stores - but let's first solve this.

regarding the cosine similarity - it is symmetrical - so it doesn't matter in which order you compare: query to doc or doc to query.

maybe i did not answer everything - but let me know how it goes !!!

kind regards
borislav

On Oct 3, 2008, at 9:01 PM, Zoran Jeremic wrote:

Hi everybody,

I'm interesting if anybody of you could help me with suggestions about how to use cosine similarity (http://en.wikipedia.org/wiki/Cosine_similarity ) to get the page relevance for some term. I suppose that some of you have already used it.

Here is the short description of what I have done:
I analize (annotate) a set of web pages to get an instances of design patterns described in my ontology. I got a term frequency inverse document frequency (http://en.wikipedia.org/wiki/Tf-idf) for each design pattern I found on the page. Now I want to sort all pages by the relevance for some specific pattern (i.e. Abstract Factory), but I'm not sure how to use cosine similarity formula here. What should be A vector, and what should be B vector? Should I compare the one page with the instance of pattern I want to check, and how can I do it?

Thanks
Zoran

_______________________________________________
NOTE: Please REPLY TO ALL to ensure that your reply reaches all members of this mailing list.

KIM-discussion mailing list
[email protected]
http://ontotext.com/mailman/listinfo/kim-discussion_ontotext.com


_______________________________________________
NOTE: Please REPLY TO ALL to ensure that your reply reaches all members of this 
mailing list.

KIM-discussion mailing list
[email protected]
http://ontotext.com/mailman/listinfo/kim-discussion_ontotext.com

Reply via email to