Changeset: d2816518acc4 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d2816518acc4 Modified Files: monetdb5/extras/rdf/rdflabels.c monetdb5/extras/rdf/rdfparams.c monetdb5/extras/rdf/rdfparams.h monetdb5/extras/rdf/rdfschema.c monetdb5/extras/rdf/rdfschema.h Branch: rdf Log Message:
Add params diffs (106 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 @@ -23,6 +23,7 @@ #include "rdfschema.h" #include "tokenizer.h" #include <math.h> +#include "rdfparams.h" // list of known ontologies int ontologyCount = 74; @@ -830,7 +831,7 @@ oid* getOntologyCandidates(oid** ontattr for (k = 0; k < num; ++k) { int found = 0; //if (freqId == 161) printf(" TFIDF score at %d ("BUNFMT") is: %f | Number of matched Prop %d \n",k, classStat[k].ontoClass, classStat[k].tfidfs,classStat[k].numMatchedProp); - if (classStat[k].tfidfs < SIM_TFIDF_THRESHOLD) break; // values not frequent enough (list is sorted by tfidfs) + if (classStat[k].tfidfs < simTfidfThreshold) break; // values not frequent enough (list is sorted by tfidfs) for (j = 0; j < ontmetadataCount && (found == 0); ++j) { oid muri = ontmetadata[0][j]; oid msuper = ontmetadata[1][j]; diff --git a/monetdb5/extras/rdf/rdfparams.c b/monetdb5/extras/rdf/rdfparams.c --- a/monetdb5/extras/rdf/rdfparams.c +++ b/monetdb5/extras/rdf/rdfparams.c @@ -28,9 +28,9 @@ #include <string.h> int dimensionFactor; -float ontologySimThreshold; int upperboundNumTables; float generalityThreshold; +float simTfidfThreshold; void createDefaultParamsFile(void){ @@ -38,9 +38,9 @@ void createDefaultParamsFile(void){ paramFile = fopen("params.ini", "wt"); - fprintf(paramFile, "dimensionFactor 3\n"); - fprintf(paramFile, "ontologySimThreshold 0.75\n"); + fprintf(paramFile, "dimensionFactor 1000\n"); fprintf(paramFile, "upperboundNumTables 1000"); + fprintf(paramFile, "simTfidfThreshold 0.75"); fclose(paramFile); } @@ -63,14 +63,14 @@ void readParamsInput(void){ dimensionFactor = atoi(value); printf("dimensionFactor = %d\n",dimensionFactor); } - else if (strcmp(variable, "ontologySimThreshold") == 0){ - ontologySimThreshold = atof(value); - printf("ontologySimThreshold = %f\n",ontologySimThreshold); - } else if (strcmp(variable, "upperboundNumTables") == 0){ upperboundNumTables = atoi(value); printf("upperboundNumTables = %d\n", upperboundNumTables); } + else if (strcmp(variable, "simTfidfThreshold") == 0){ + simTfidfThreshold = atof(value); + printf("simTfidfThreshold = %f\n", simTfidfThreshold); + } } } diff --git a/monetdb5/extras/rdf/rdfparams.h b/monetdb5/extras/rdf/rdfparams.h --- a/monetdb5/extras/rdf/rdfparams.h +++ b/monetdb5/extras/rdf/rdfparams.h @@ -32,9 +32,9 @@ extern int dimensionFactor; -extern float ontologySimThreshold; extern int upperboundNumTables; extern float generalityThreshold; +extern float simTfidfThreshold; rdf_export void createDefaultParamsFile(void); diff --git a/monetdb5/extras/rdf/rdfschema.c b/monetdb5/extras/rdf/rdfschema.c --- a/monetdb5/extras/rdf/rdfschema.c +++ b/monetdb5/extras/rdf/rdfschema.c @@ -4683,9 +4683,9 @@ void mergeCSByS4(CSset *freqCSset, CSlab isSameLabel = 0; if ((*labels)[freqId1].name == (*labels)[freqId2].name) isSameLabel = 1; - if (simscore > SIM_TFIDF_THRESHOLD && (existDiscriminatingProp || isSameLabel)){ + if (simscore > simTfidfThreshold && (existDiscriminatingProp || isSameLabel)){ #else - if (simscore > SIM_TFIDF_THRESHOLD && existDiscriminatingProp){ + if (simscore > simTfidfThreshold && existDiscriminatingProp){ #endif #else if (simscore > SIM_THRESHOLD) { diff --git a/monetdb5/extras/rdf/rdfschema.h b/monetdb5/extras/rdf/rdfschema.h --- a/monetdb5/extras/rdf/rdfschema.h +++ b/monetdb5/extras/rdf/rdfschema.h @@ -234,7 +234,7 @@ typedef struct SubCSSet{ #define INIT_NUM_CS 1000 #define SIM_THRESHOLD 0.6 -#define SIM_TFIDF_THRESHOLD 0.75 +//#define SIM_TFIDF_THRESHOLD 0.75 //Replaced by simTfidfThreshold //#define IMPORTANCE_THRESHOLD 0.001 //This is used when merging CS's by common ancestor // Replace by generalityThreshold = 1/(upperboundNumTables) #define COMMON_ANCESTOR_LOWEST_SPECIFIC_LEVEL 2 _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list