From: <ku...@us...> - 2008-05-19 10:14:54
|
Revision: 896 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=896&view=rev Author: kurzum Date: 2008-05-19 03:14:48 -0700 (Mon, 19 May 2008) Log Message: ----------- commit before cleanup Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java trunk/src/dl-learner/org/dllearner/scripts/SKOS7030.java trunk/src/dl-learner/org/dllearner/utilities/AutomaticExampleFinderSKOSSPARQL.java trunk/src/dl-learner/org/dllearner/utilities/LearnSparql.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-05-17 05:20:45 UTC (rev 895) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-05-19 10:14:48 UTC (rev 896) @@ -387,7 +387,7 @@ //HACK @Override - public SortedSet<String> getBestSolutionsAsKBSyntax(int nrOfSolutions){ + public List<String> getBestSolutionsAsKBSyntax(int nrOfSolutions){ return this.algorithm.getBestSolutionsAsKBSyntax(nrOfSolutions); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-05-17 05:20:45 UTC (rev 895) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-05-19 10:14:48 UTC (rev 896) @@ -1071,9 +1071,9 @@ } //HACK - public SortedSet<String> getBestSolutionsAsKBSyntax(int nrOfSolutions){ + public List<String> getBestSolutionsAsKBSyntax(int nrOfSolutions){ if(nrOfSolutions==0)nrOfSolutions=99999; - SortedSet<String> result = new TreeSet<String>(); + List<String> result = new LinkedList<String>(); for (Description d : solutions) { result.add(d.toKBSyntaxString()); Modified: trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2008-05-17 05:20:45 UTC (rev 895) +++ trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2008-05-19 10:14:48 UTC (rev 896) @@ -65,7 +65,7 @@ } //HACK - public SortedSet<String> getBestSolutionsAsKBSyntax(int nrOfSolutions){ + public List<String> getBestSolutionsAsKBSyntax(int nrOfSolutions){ return null; } Modified: trunk/src/dl-learner/org/dllearner/scripts/SKOS7030.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SKOS7030.java 2008-05-17 05:20:45 UTC (rev 895) +++ trunk/src/dl-learner/org/dllearner/scripts/SKOS7030.java 2008-05-19 10:14:48 UTC (rev 896) @@ -74,10 +74,10 @@ static boolean closeAfterRecursion=true; static boolean randomizeCache=false; - static int resultsize=50; + static int resultsize=20; static double noise=15; static int limit=200; - static double percentage=0.7; + static double percentage=0.3; /** * @param args @@ -113,18 +113,19 @@ String award=("http://dbpedia.org/resource/Category:Best_Actor_Academy_Award_winners"); - double acc1=0.0; - for (int i = 0; i < 5; i++) { - acc1+=DBpediaSKOS(prim); - } - System.out.println("accprim"+(acc1/5)); + System.out.println(DBpediaSKOS(prim)); +// double acc1=0.0; +// for (int i = 0; i < 5; i++) { +// acc1+=DBpediaSKOS(prim); +// } +// System.out.println("accprim"+(acc1/5)); +// +// double acc2=0.0; +// for (int i = 0; i < 5; i++) { +// acc2+=DBpediaSKOS(award); +// } +// System.out.println("accprim"+(acc2/5)); - double acc2=0.0; - for (int i = 0; i < 5; i++) { - acc2+=DBpediaSKOS(award); - } - System.out.println("accprim"+(acc2/5)); - // DBpediaSKOS(concepts.first()); // DBpediaSKOS(concepts.first()); // concepts.remove(concepts.first()); @@ -190,7 +191,7 @@ //igno.add(oneConcept.replaceAll("\"", "")); - SortedSet<String> conceptresults= ls.learnDBpediaSKOS(posExamples, negExamples, url,new TreeSet<String>(),recursiondepth, closeAfterRecursion,randomizeCache,resultsize,noise); + List<String> conceptresults= ls.learnDBpediaSKOS(posExamples, negExamples, url,new TreeSet<String>(),recursiondepth, closeAfterRecursion,randomizeCache,resultsize,noise); System.out.println("concepts"+conceptresults); //System.exit(0); @@ -242,12 +243,12 @@ double accuracy= (double)i/rest.size(); double accuracy2= (double)a/totalSKOSset.size(); - res.add(new ResultCompare(oneConcept,instances,accuracy,accuracy2,instances.size(), - coveredInRest,possibleNewCandidates,notCoveredInTotal)); + logger.debug((new ResultCompare(oneConcept,instances,accuracy,accuracy2,instances.size(), + coveredInRest,possibleNewCandidates,notCoveredInTotal)).toStringFull()); //if(instances.size()>=0)System.out.println("size of instances "+instances.size()); //if(instances.size()>=0 && instances.size()<100) System.out.println("instances"+instances); - }catch (Exception e) {} + }catch (Exception e) {e.printStackTrace();} } // System.out.println(res.last()); @@ -259,24 +260,24 @@ // //double percent=0.80*(double)res.size();; - double acc=res.first().accuracy; - logger.debug(res.first().toStringFull()); - res.remove(res.first()); - logger.debug(res.first().toStringFull()); - res.remove(res.first()); - int i=0; - while (res.size()>0){ - logger.debug(res.first()); - res.remove(res.first()); - //if(res.size()<=percent)break; - if(i>50)break; - i++; - - } +// double acc=res.first().accuracy; +// logger.debug(res.first().toStringFull()); +// res.remove(res.first()); +// logger.debug(res.first().toStringFull()); +// res.remove(res.first()); +// int i=0; +// while (res.size()>0){ +// logger.debug(res.first()); +// res.remove(res.first()); +// //if(res.size()<=percent)break; +// if(i>50)break; +// i++; +// +// } +// + return 0.0; - return acc; - //System.out.println("AAAAAAAA"); //System.exit(0); //"relearned concept: "; Modified: trunk/src/dl-learner/org/dllearner/utilities/AutomaticExampleFinderSKOSSPARQL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/AutomaticExampleFinderSKOSSPARQL.java 2008-05-17 05:20:45 UTC (rev 895) +++ trunk/src/dl-learner/org/dllearner/utilities/AutomaticExampleFinderSKOSSPARQL.java 2008-05-19 10:14:48 UTC (rev 896) @@ -43,7 +43,7 @@ totalSKOSset.addAll(this.posExamples); rest.addAll(totalSKOSset); int poslimit=(int)Math.round(percent*totalSKOSset.size()); - int neglimit=(int)Math.round(2*poslimit); + int neglimit=(int)Math.round(poslimit); /*while (this.posExamples.size()>poslimit) { this.posExamples.remove(posExamples.last()); }*/ Modified: trunk/src/dl-learner/org/dllearner/utilities/LearnSparql.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/LearnSparql.java 2008-05-17 05:20:45 UTC (rev 895) +++ trunk/src/dl-learner/org/dllearner/utilities/LearnSparql.java 2008-05-19 10:14:48 UTC (rev 896) @@ -1,6 +1,7 @@ package org.dllearner.utilities; import java.util.HashSet; +import java.util.List; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; @@ -110,7 +111,7 @@ //System.out.println( la.getBestSolution());; } - public SortedSet<String> learnDBpediaSKOS(SortedSet<String> posExamples,SortedSet<String> negExamples, + public List<String> learnDBpediaSKOS(SortedSet<String> posExamples,SortedSet<String> negExamples, String uri, SortedSet<String> ignoredConcepts, int recursiondepth, boolean closeAfterRecursion, boolean randomizeCache, int resultsize, double noise){ @@ -168,7 +169,7 @@ cm.applyConfigEntry(la,"useCardinalityRestrictions",false); cm.applyConfigEntry(la,"useNegation",false); cm.applyConfigEntry(la,"minExecutionTimeInSeconds",0); - cm.applyConfigEntry(la,"maxExecutionTimeInSeconds",150); + cm.applyConfigEntry(la,"maxExecutionTimeInSeconds",30); cm.applyConfigEntry(la,"guaranteeXgoodDescriptions",40); cm.applyConfigEntry(la,"writeSearchTree",true); cm.applyConfigEntry(la,"searchTreeFile","log/SKOS.txt"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |