least common subsumer

37 views
Skip to first unread message

Andrea Apicella

unread,
Mar 31, 2015, 5:50:07 PM3/31/15
to wiki...@googlegroups.com
Hi all!
Does anyone know any method to compute least common subsumer in category graph?
thanks!

Shilad Sen

unread,
Apr 1, 2015, 1:19:38 AM4/1/15
to Andrea Apicella, wiki...@googlegroups.com
Andrea,

There are a few related pieces of code, but none that give you the actual parent. In the CategoryGraphSimilarity, the similarity method returns the distance between two pages and their least common subsumer (but not the subsumer itself). In LocalCategoryMemberSqlDao, getClosestCategory will return the closest category from a particular page to a set of candidate categories.

In both cases, edges are weighted according to the pagerank of a category to penalize very "broad" categories. The also both use the CategoryBfs helper class.

Your best bet if you need the actual subsumer itself would probably be to adapt the CategoryGraphSimilarity code to record the subsumer.

Let me know if you have follow up questions!

-Shilad


--
You received this message because you are subscribed to the Google Groups "wikibrain" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wikibrain+...@googlegroups.com.
To post to this group, send email to wiki...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wikibrain/507e2320-877f-421a-a78b-2a465a319006%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Shilad W. Sen
Associate Professor
Mathematics, Statistics, and Computer Science Dept.
Macalester College
ss...@macalester.edu

Andrea Apicella

unread,
Apr 1, 2015, 6:52:22 AM4/1/15
to wiki...@googlegroups.com, and....@gmail.com
So, if I understand, with

SRMetric sr = configurator.get(
             SRMetric.class, "category",
             "language", simple.getLangCode());

 int id1=pageDao.getIdByTitle("Category:Sports",simple,NameSpace.CATEGORY);
 int id2=pageDao.getIdByTitle("Category:Football",simple,NameSpace.CATEGORY);

SRResult s=sr.similarity(id1, id2, false);

I get similarity between category1 and category2 passing for lcs(category1,category2), right?

I need distance of anyone of them from lcs, i.e. s1=similarity(category1, lcs(category1,category2))  and s2=similarity(category2, lcs(category1,category2))..
is there a way to do that?
thanks!

Reply all
Reply to author
Forward
0 new messages