From: <ku...@us...> - 2008-08-29 19:14:24
|
Revision: 1140 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1140&view=rev Author: kurzum Date: 2008-08-29 19:14:22 +0000 (Fri, 29 Aug 2008) Log Message: ----------- servercommit Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java Modified: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 19:02:55 UTC (rev 1139) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java 2008-08-29 19:14:22 UTC (rev 1140) @@ -61,7 +61,7 @@ private static Logger logger = Logger.getRootLogger(); // size of randomly choosen negative examples compared to positives - public static double NEGFACTOR = 20.0; + public static double NEGFACTOR = 2.0; // different negative Ex (randomizes) each run, if set to false private static final boolean DEVELOP = true; @@ -78,6 +78,9 @@ initLogger(); logger.info("Start"); + + + //String fileURL = new File(ontologyFile).toURI().toString(); reasoningService = ReasoningServiceFactory.getReasoningService( @@ -90,11 +93,14 @@ // } - SortedSet<NamedClass> classesToRelearn = getClassesToRelearn(true); + SortedSet<NamedClass> classesToRelearn = getClassesToRelearn(false); SortedSet<Individual> positiveEx = new TreeSet<Individual>(); SortedSet<Individual> negativeEx = new TreeSet<Individual>(); for (NamedClass target : classesToRelearn) { + System.out.println("now learning: "+target); + waitForInput(); + positiveEx.clear(); negativeEx.clear(); @@ -106,17 +112,23 @@ AutomaticNegativeExampleFinderOWL ane = new AutomaticNegativeExampleFinderOWL( positiveEx, reasoningService); ane.makeNegativeExamplesFromSuperClasses(target); - ane.makeNegativeExamplesFromAllOtherInstances(); + //ane.makeNegativeExamplesFromAllOtherInstances(); //double correct = () // System.out.println((positiveEx.size()*NEGFACTOR)); negativeEx = ane.getNegativeExamples( (int) (positiveEx.size() * NEGFACTOR), DEVELOP); + if(negativeEx.size()<=3) { + System.out.println(target); + waitForInput(); + continue; + } // reasoningService.prepareSubsumptionHierarchy(); // System.out.println(reasoningService.getMoreGeneralConcepts(target)); // for every class execute the learning algorithm learnOriginal(target, positiveEx, negativeEx); + waitForInput(); } @@ -162,11 +174,13 @@ lc.guaranteeXgoodDescriptions = 20; lc.maxExecutionTimeInSeconds = 0; - lc.useAllConstructor = true; - lc.useCardinalityRestrictions = true; + boolean extended = false; + lc.useAllConstructor = extended; + lc.useCardinalityRestrictions = extended; + lc.useNegation = extended; + lc.useExistsConstructor = true; - lc.useNegation = true; - + // lsc.searchTreeFile = "log/WikipediaCleaner.txt"; return lc; @@ -185,7 +199,7 @@ lc.noisePercentage = 0; lc.guaranteeXgoodDescriptions = 20; - lc.maxExecutionTimeInSeconds = 50; + lc.maxExecutionTimeInSeconds = 20; lc.writeSearchTree = false; lc.replaceSearchTree = true; lc.searchTreeFile = "log/treeSemanticBible.txt"; @@ -357,4 +371,13 @@ return classesToRelearn; } + public static void waitForInput(){ + System.out.println("PRESS ENTER TO CONTINUE"); + byte[] b = new byte[100]; + try{System.in.read(b); + + }catch (Exception e) { + + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |