【发布时间】:2016-08-10 07:52:10
【问题描述】:
我正在使用设置,我从 github 下载并设置包,链接如下:
https://github.com/graphaware/reco4php
我还安装了 php7 和 neo7j,它们在 localhost (ubuntu16.04) 上正常运行。
我在浏览器中遇到错误:
Fatal error: Uncaught Error: Class 'GraphAware\Reco4PHP\Demo\Github\RecommendationEngine' not found in /var/www/html/recommendation_2/example.php:9 Stack trace: #0 {main} thrown in /var/www/html/recommendation_2/example.php on line 9
当点击 example.php 表单 browser.example.php 文件代码如下:
<?php
// example.php file
require_once __DIR__.'/vendor/autoload.php';
use GraphAware\Reco4PHP\Demo\Github\RecommendationEngine;
use GraphAware\Reco4PHP\RecommenderService;
$rs = RecommenderService::create("http://neo4j:idealindore@localhost:7474");
$rs->registerRecommendationEngine(new RecommendationEngine());
$stopwatch = new \Symfony\Component\Stopwatch\Stopwatch();
$input = $rs->findInputBy('User', 'login', 'jakzal');
$engine = $rs->getRecommender("github_who_to_follow");
$stopwatch->start('reco');
$recommendations = $engine->recommend($input);
$e = $stopwatch->stop('reco');
//echo $recommendations->size() . ' found in ' . $e->getDuration() . 'ms' .PHP_EOL;
foreach ($recommendations->getItems(10) as $reco) {
echo $reco->item()->get('login') . PHP_EOL;
echo $reco->totalScore() . PHP_EOL;
foreach ($reco->getScores() as $name => $score) {
echo "\t" . $name . ':' . $score->score() . PHP_EOL;
}
}
谁能帮我解决这个问题?
【问题讨论】:
-
是的,我也设置了 reco4j 并得到了同样的错误,如果有人帮助解决这个问题,它将对我有所帮助。提前致谢。
-
是的,我也在寻找解决方案,我也在尝试运行设置,如果我得到解决方案,我会在这里发布。如果您有任何解决方案,请告知。
标签: php neo4j recommendation-engine