Changeset: 9db5008798de for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9db5008798de
Modified Files:
        monetdb5/extras/rdf/rdflabels.c
Branch: rdf
Log Message:

fix baseline for normalizing tf-idf scores


diffs (30 lines):

diff --git a/monetdb5/extras/rdf/rdflabels.c b/monetdb5/extras/rdf/rdflabels.c
--- a/monetdb5/extras/rdf/rdflabels.c
+++ b/monetdb5/extras/rdf/rdflabels.c
@@ -1413,7 +1413,7 @@ void createPropStatistics(PropStat* prop
 */
 //[DUC] Create propstat for ontology only 
 static
-void createPropStatistics(PropStat* propStat, oid** ontattributes, int 
ontattributesCount) {
+void createPropStatistics(PropStat* propStat, oid** ontattributes, int 
ontattributesCount, int ontmetadataCount) {
        int             i;
        int             numProps = 0;
 
@@ -1445,7 +1445,7 @@ void createPropStatistics(PropStat* prop
        }
 
        for (i = 0; i < propStat->numAdded; ++i) {
-               propStat->tfidfs[i] = log(((float)numProps) / (1 + 
propStat->freqs[i]));
+               propStat->tfidfs[i] = log(((float)ontmetadataCount) / (1 + 
propStat->freqs[i]));
        }
 }
 
@@ -1475,7 +1475,7 @@ void createOntologyLookupResult(oid** re
        //[DUC] Change the function for getting propStat. Use ontattributes for 
the propStat. 
        // Not the properties from freqCS
        //createPropStatistics(propStat, freqCSset->numCSadded, freqCSset);
-       createPropStatistics(propStat, ontattributes, ontattributesCount);
+       createPropStatistics(propStat, ontattributes, ontattributesCount, 
ontmetadataCount);
 
        for (i = 0; i < freqCSset->numCSadded; ++i) {
                CS              cs;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to