当前位置: 首页>>代码示例>>PHP>>正文


PHP SoapClient::setLearningProblem方法代码示例

本文整理汇总了PHP中SoapClient::setLearningProblem方法的典型用法代码示例。如果您正苦于以下问题:PHP SoapClient::setLearningProblem方法的具体用法?PHP SoapClient::setLearningProblem怎么用?PHP SoapClient::setLearningProblem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SoapClient的用法示例。


在下文中一共展示了SoapClient::setLearningProblem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: realpath

 */
include 'Utilities.php';
// load WSDL files (has to be done due to a Java web service bug)
ini_set("soap.wsdl_cache_enabled", "0");
$wsdluri = "http://localhost:8181/services?wsdl";
// Utilities::loadWSDLfiles($wsdluri);
// specifiy ontology
$ontology = 'file:' . realpath("../../examples/swore/swore.rdf");
// create DL-Learner client
$client = new SoapClient("main.wsdl");
// $client = new SoapClient($wsdluri);
$id = $client->generateID();
$ksID = $client->addKnowledgeSource($id, "owlfile", $ontology);
$rID = $client->setReasoner($id, "fastInstanceChecker");
// create a learning problem
$lp = $client->setLearningProblem($id, "classLearning");
$client->applyConfigEntryURL($id, $lp, "classToDescribe", "http://ns.softwiki.de/req/CustomerRequirement");
$la_id = $client->setLearningAlgorithm($id, "celoe");
$client->applyConfigEntryInt($id, $la_id, "maxExecutionTimeInSeconds", 5);
$client->initAll($id);
// learn concept
echo 'start learning ... ';
// get only concept
// $concept = $client->learn($id, "manchester");
// get concept and additional information in JSON syntax
$concept = $client->learnDescriptionsEvaluated($id);
echo 'OK <br />';
// echo htmlspecialchars($concept);
echo 'solution: <pre>';
var_dump(json_decode($concept, true));
echo '</pre>';
开发者ID:Rygbee,项目名称:DL-Learner,代码行数:31,代码来源:LearningClass.php

示例2: array

}
$examples = array('http://dbpedia.org/resource/Leipzig', 'http://dbpedia.org/resource/Dresden');
$client = new SoapClient("main.wsdl", array('features' => SOAP_SINGLE_ELEMENT_ARRAYS));
$id = $client->generateID();
$ksID = $client->addKnowledgeSource($id, "sparqlfrag", "http://dbpedia.org/sparql");
$client->applyConfigEntryInt($id, $ksID, "recursionDepth", 2);
$filterClasses = array("http://xmlns.com/foaf/", "http://dbpedia.org/class/yago/", "http://dbpedia.org/ontology/Resource");
$relatedInstances = array('http://dbpedia.org/resource/Berlin', 'http://dbpedia.org/resource/London');
$instances = array_merge($examples, $relatedInstances);
$client->applyConfigEntryStringArray($id, $ksID, "instances", $instances);
$client->applyConfigEntryString($id, $ksID, "predefinedFilter", "DBPEDIA-NAVIGATOR");
$client->applyConfigEntryString($id, $ksID, "predefinedEndpoint", "DBPEDIA");
$client->applyConfigEntryBoolean($id, $ksID, "saveExtractedFragment", true);
$client->applyConfigEntryBoolean($id, $ksID, "propertyInformation", true);
$rID = $client->setReasoner($id, "cwr");
$client->setLearningProblem($id, "posonlylp");
$client->setPositiveExamples($id, $examples);
$laID = $client->setLearningAlgorithm($id, "celoe");
$client->applyConfigEntryInt($id, $laID, "maxExecutionTimeInSeconds", 1);
$client->initAll($id);
echo '<p>Positive examples:<br />';
foreach ($examples as $example) {
    echo $example . '<br />';
}
echo '</p>';
echo '<p>Additional instances:<br />';
foreach ($relatedInstances as $related) {
    echo $related . '<br />';
}
echo '</p>';
echo '<p>start learning ... ';
开发者ID:Rygbee,项目名称:DL-Learner,代码行数:31,代码来源:Suggestions.php

示例3: realpath

// load WSDL files (has to be done due to a Java web service bug)
ini_set("soap.wsdl_cache_enabled", "0");
$wsdluri = "http://localhost:8181/services?wsdl";
Utilities::loadWSDLfiles($wsdluri);
// specifiy ontology
$ontology = 'file:' . realpath("../examples/family/uncle.owl");
// create DL-Learner client
$client = new SoapClient("main.wsdl");
// load owl file in reasoner
$id = $client->generateID();
$ksID = $client->addKnowledgeSource($id, "owlfile", $ontology);
$rID = $client->setReasoner($id, "cwr");
// create a learning problem
$posExamples = array('http://localhost/foo#heinrich', 'http://localhost/foo#alfred', 'http://localhost/foo#heinz', 'http://localhost/foo#hans', 'http://localhost/foo#alex');
$negExamples = array('http://localhost/foo#jan', 'http://localhost/foo#markus', 'http://localhost/foo#susi', 'http://localhost/foo#anna', 'http://localhost/foo#maria', 'http://localhost/foo#katrin', 'http://localhost/foo#johanna', 'http://localhost/foo#mandy', 'http://localhost/foo#miriam', 'http://localhost/foo#hanna');
$client->setLearningProblem($id, "posNegStandard");
$client->setPositiveExamples($id, $posExamples);
$client->setNegativeExamples($id, $negExamples);
// choose refinement operator approach
$client->setLearningAlgorithm($id, "celoe");
$client->initAll($id);
// start learning process in DL-Learner
$client->learnThreaded($id);
$sleeptime = 2;
$seconds = 0;
do {
    // sleep a while
    sleep($sleeptime);
    // see what we have learned so far
    $concept = $client->getCurrentlyBestConcept($id);
    $running = $client->isAlgorithmRunning($id);
开发者ID:Rygbee,项目名称:DL-Learner,代码行数:31,代码来源:LearningThreaded.php

示例4: array

$ksID = $client->addKnowledgeSource($id, "sparql", "http://dbpedia.org/sparql");
$client->applyConfigEntryInt($id, $ksID, "recursionDepth", 2);
$filterClasses = array("http://xmlns.com/foaf/", "http://dbpedia.org/class/yago/", "http://dbpedia.org/ontology/Resource");
// $relatedInstances = $client->getNegativeExamples($id,$ksID,$examples,count($examples),"http://dbpedia.org/resource/",$filterClasses);
// $relatedInstances = $relatedInstances->item;
$relatedInstances = array('http://dbpedia.org/resource/Berlin', 'http://dbpedia.org/resource/London');
$instances = array_merge($examples, $relatedInstances);
$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->applyConfigEntryBoolean($id, $ksID, "saveExtractedFragment", true);
// $client->applyConfigEntryBoolean($id, $ksID, "useLits", true);
$client->applyConfigEntryBoolean($id, $ksID, "getPropertyInformation", true);
$rID = $client->setReasoner($id, "fastInstanceChecker");
$client->setLearningProblem($id, "posOnlyLP");
$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);
echo '<p>Positive examples:<br />';
foreach ($examples as $example) {
    echo $example . '<br />';
}
echo '</p>';
echo '<p>Additional instances:<br />';
foreach ($relatedInstances as $related) {
    echo $related . '<br />';
}
开发者ID:Rygbee,项目名称:DL-Learner,代码行数:31,代码来源:Suggestions.php


注:本文中的SoapClient::setLearningProblem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。