From: <ku...@us...> - 2008-08-29 21:33:37
|
Revision: 1147 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1147&view=rev Author: kurzum Date: 2008-08-29 21:33:35 +0000 (Fri, 29 Aug 2008) Log Message: ----------- servercommit Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticPositiveExampleFinderOWL.java Modified: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 20:24:35 UTC (rev 1146) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 21:33:35 UTC (rev 1147) @@ -63,7 +63,7 @@ private static Logger logger = Logger.getRootLogger(); // size of randomly choosen negative examples compared to positives - public static double NEGFACTOR = 200.0; + public static double NEGFACTOR = 1.0; // different negative Ex (randomizes) each run, if set to false private static final boolean DEVELOP = true; @@ -126,7 +126,7 @@ AutomaticPositiveExampleFinderOWL ape = new AutomaticPositiveExampleFinderOWL( reasoningService); ape.makePositiveExamplesFromConcept(target); - positiveEx = ape.getPosExamples(); + positiveEx.addAll(ape.getPosExamples()); AutomaticNegativeExampleFinderOWL ane = new AutomaticNegativeExampleFinderOWL( positiveEx, reasoningService); @@ -135,10 +135,10 @@ else{ ane.makeNegativeExamplesFromSuperClasses(target);} //double correct = () // System.out.println((positiveEx.size()*NEGFACTOR)); - negativeEx = ane.getNegativeExamples( - (int) (positiveEx.size() * NEGFACTOR), DEVELOP); + negativeEx.addAll(ane.getNegativeExamples( + (int) (positiveEx.size() * NEGFACTOR), DEVELOP)); - if(negativeEx.size()<=3) { + if(negativeEx.size()<0) { System.out.println(target); waitForInput(); Files.appendFile(file, "\tSKIPPED negEX "+negativeEx+"\n"); Modified: trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java 2008-08-29 20:24:35 UTC (rev 1146) +++ trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java 2008-08-29 21:33:35 UTC (rev 1147) @@ -122,7 +122,8 @@ */ public void makeNegativeExamplesFromAllOtherInstances() { logger.debug("making random examples "); - fromAllOther = reasoningService.getIndividuals(); + fromAllOther.clear(); + fromAllOther.addAll(reasoningService.getIndividuals()); fromAllOther.removeAll(fullPositiveSet); logger.debug("|-negExample size from random: " + fromAllOther.size()); } @@ -178,8 +179,8 @@ private void makeNegativeExamplesFromClassesOfInstances(SortedSet<Individual> positiveSet) { logger.debug("making neg Examples from parallel classes"); SortedSet<Description> classes = new TreeSet<Description>(); + this.fromParallelClasses.clear(); - for (Individual instance : positiveSet) { try{ // realization is not implemented in reasoningservice @@ -226,7 +227,7 @@ */ public void makeNegativeExamplesFromSuperClasses(NamedClass concept, int depth) { - + fromSuperclasses.clear(); SortedSet<Description> superClasses = reasoningService.getMoreGeneralConcepts(concept); logger.debug("making neg Examples from " + superClasses.size() + " superclasses"); @@ -246,6 +247,7 @@ */ public void makeNegativeExamplesFromDomain(ObjectProperty atomicRole){ + fromDomain.clear(); logger.debug("making Negative Examples from Domain of : "+atomicRole); fromDomain.addAll(reasoningService.getRoleMembers(atomicRole).keySet()); fromDomain.removeAll(fullPositiveSet); @@ -260,6 +262,7 @@ */ public void makeNegativeExamplesFromRange(ObjectProperty atomicRole){ + fromRange.clear(); logger.debug("making Negative Examples from Range of : "+atomicRole); Collection<SortedSet<Individual>> tmp = reasoningService.getRoleMembers(atomicRole).values(); for (SortedSet<Individual> set : tmp) { Modified: trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticPositiveExampleFinderOWL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticPositiveExampleFinderOWL.java 2008-08-29 20:24:35 UTC (rev 1146) +++ trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticPositiveExampleFinderOWL.java 2008-08-29 21:33:35 UTC (rev 1147) @@ -28,7 +28,8 @@ //QUALITY resultsize is not accounted for public void makePositiveExamplesFromConcept(Description concept){ logger.debug("making Positive Examples from Concept: "+concept); - this.posExamples = reasoningService.retrieval(concept); + this.posExamples.clear(); + this.posExamples.addAll(reasoningService.retrieval(concept)); //this.posExamples = sparqltasks.retrieveInstancesForClassDescription(conceptKBSyntax, 0); logger.debug("pos Example size: "+posExamples.size()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |