From: <jen...@us...> - 2009-06-03 09:45:57
|
Revision: 1786 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1786&view=rev Author: jenslehmann Date: 2009-06-03 09:45:55 +0000 (Wed, 03 Jun 2009) Log Message: ----------- suggestion test Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java trunk/src/php-examples/Suggestions.php Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java 2009-06-02 17:12:23 UTC (rev 1785) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java 2009-06-03 09:45:55 UTC (rev 1786) @@ -373,7 +373,8 @@ } public static SparqlQueryMaker getDBpediaNavigatorFilter() { - SparqlQueryMaker sqm = new SparqlQueryMaker("allow", new TreeSet<String>(), new TreeSet<String>(), false); +// SparqlQueryMaker sqm = new SparqlQueryMaker("allow", new TreeSet<String>(), new TreeSet<String>(), false); + SparqlQueryMaker sqm = new SparqlQueryMaker("allow", new TreeSet<String>(), new TreeSet<String>(), true); // sqm.addPredicateFilter("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); // sqm.addPredicateFilter("http://www.w3.org/2000/01/rdf-schema#subClassOf"); // sqm.addPredicateFilter("http://www.w3.org/2003/01/geo/wgs84_pos#lat"); Modified: trunk/src/php-examples/Suggestions.php =================================================================== --- trunk/src/php-examples/Suggestions.php 2009-06-02 17:12:23 UTC (rev 1785) +++ trunk/src/php-examples/Suggestions.php 2009-06-03 09:45:55 UTC (rev 1786) @@ -24,8 +24,10 @@ $client->applyConfigEntryStringArray($id, $ksID, "instances", $instances); $client->applyConfigEntryString($id, $ksID, "predefinedFilter", "DBPEDIA-NAVIGATOR"); $client->applyConfigEntryString($id, $ksID, "predefinedEndpoint", "LOCALDBPEDIA"); -$client->applyConfigEntryString($id, $ksID, "predefinedManipulator", "DBPEDIA-NAVIGATOR"); +// $client->applyConfigEntryString($id, $ksID, "predefinedManipulator", "DBPEDIA-NAVIGATOR"); $client->applyConfigEntryBoolean($id, $ksID, "saveExtractedFragment", true); +// $client->applyConfigEntryBoolean($id, $ksID, "useLits", true); +$client->applyConfigEntryBoolean($id, $ksID, "getPropertyInformation", true); $rID = $client->setReasoner($id, "fastInstanceChecker"); @@ -33,6 +35,9 @@ $client->setPositiveExamples($id, $examples); $laID = $client->setLearningAlgorithm($id, "celoe"); +$client->applyConfigEntryInt($id, $laID, "maxExecutionTimeInSeconds", 1); +$client->applyConfigEntryBoolean($id, $laID, "useHasValueConstructor", true); +$client->applyConfigEntryInt($id, $laID, "valueFrequencyThreshold", 2); $client->initAll($id); @@ -43,19 +48,27 @@ echo '</p>'; echo '<p>Additional instances:<br />'; -foreach($relatedinstances as $related) { +foreach($relatedInstances as $related) { echo $related.'<br />'; } echo '</p>'; -echo 'start learning ... '; -$concepts = $client->learnDescriptionsEvaluated($id, 5); -echo 'OK <br />'; +echo '<p>start learning ... '; +$startTime = microtime(true); +$concepts = $client->learnDescriptionsEvaluated($id, 10); +$runTime = microtime(true) - $startTime; +echo 'OK ('.$runTime.' seconds)</p>'; $concepts = json_decode($concepts); +// var_dump($concepts); + +echo '<table border="1px"><tr><td><i>natural description</i></td><td><i>Manchester OWL Syntax</i></td><td><i>accuracy</i></td></tr>'; foreach($concepts as $concept) { - echo $concept; + $natural = $client->getNaturalDescription($id, $concept->descriptionKBSyntax); + // echo $natural . '(Manchester: ' . $concept->descriptionManchesterSyntax . ', acc. ' . $concept->scoreValue . ')<br />'; ; + echo '<tr><td>'.$natural.'</td><td>'.$concept->descriptionManchesterSyntax.'</td><td>'.$concept->scoreValue.'</td></tr>'; } +echo '</table>'; ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |