Skip to content

Commit

Permalink
No more predict sample
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdalpino committed May 8, 2021
1 parent 7a45981 commit 5cb9106
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion predict.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@

use Rubix\ML\PersistentModel;
use Rubix\ML\Persisters\Filesystem;
use Rubix\ML\Datasets\Unlabeled;

ini_set('memory_limit', '-1');

$estimator = PersistentModel::load(new Filesystem('sentiment.rbx'));

while (empty($text)) $text = readline("Enter some text to analyze:\n");

$prediction = $estimator->predictSample([$text]);
$dataset = new Unlabeled([
[$text],
]);

$prediction = current($estimator->predict($dataset));

echo "The sentiment is: $prediction" . PHP_EOL;

0 comments on commit 5cb9106

Please sign in to comment.