1. Go to this page and download the library: Download survos/classifier-bundle 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/ */
survos / classifier-bundle example snippets
use Survos\ClassifierBundle\Vocabulary\ArrayVocabulary;
$lawsuits = ArrayVocabulary::fromRows('lawsuit', [
['code' => 'engle', 'label' => 'Engle v. Liggett', 'properNouns' => ['Engle'],
'definition' => 'The article is about the Engle class action or its progeny cases.'],
]);
use Survos\ClassifierBundle\Model\Document;
use Survos\ClassifierBundle\Policy\AssignmentMerger;
use Survos\ClassifierBundle\Strategy\RulesStrategy;
use Survos\ClassifierBundle\Vocabulary\VocabularyRegistry;
$result = $rules->classify(new Document($id, $headline, $summary), $registry->get('country'));
if ($result->abstained === null) {
// Keeps editor assignments; replaces this strategy's earlier ones in this vocabulary.
$assignments = $merger->merge($existingAssignments, $result);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.