PHP code example of hybridlogic / classifier

1. Go to this page and download the library: Download hybridlogic/classifier library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hybridlogic / classifier example snippets



$tokenizer = new HybridLogic\Classifier\Basic;
$classifier = new HybridLogic\Classifier($tokenizer);

$classifier->train('hot', 'The sun is hot');
$classifier->train('hot', 'It was a warm day in the sun');
$classifier->train('hot', 'This tea is hot!');

$classifier->train('cold', 'This ice is very cold!');
$classifier->train('cold', 'It\'s cold at night');
$classifier->train('cold', 'Ice formed on my at over night');

$groups = $classifier->classify('It was chilly last night');