We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a45981 commit 5cb9106Copy full SHA for 5cb9106
predict.php
@@ -4,13 +4,18 @@
4
5
use Rubix\ML\PersistentModel;
6
use Rubix\ML\Persisters\Filesystem;
7
+use Rubix\ML\Datasets\Unlabeled;
8
9
ini_set('memory_limit', '-1');
10
11
$estimator = PersistentModel::load(new Filesystem('sentiment.rbx'));
12
13
while (empty($text)) $text = readline("Enter some text to analyze:\n");
14
-$prediction = $estimator->predictSample([$text]);
15
+$dataset = new Unlabeled([
16
+ [$text],
17
+]);
18
+
19
+$prediction = current($estimator->predict($dataset));
20
21
echo "The sentiment is: $prediction" . PHP_EOL;
0 commit comments