1. Go to this page and download the library: Download survos/ai-claims-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 / ai-claims-bundle example snippets
use Survos\ClaimsBundle\Service\ClaimIngestor;
use Survos\ClaimsBundle\Service\RawClaim;
use Survos\DataContracts\Vocabulary\DcTerms;
$rawClaims = [
new RawClaim(DcTerms::TITLE->value, 'Welcome to Ocean City', 0.9,
basis: "Printed caption reads 'Welcome to Ocean City'."),
new RawClaim(DcTerms::DESCRIPTION->value, 'Beach scene with boardwalk.', 0.8),
new RawClaim(DcTerms::TYPE->value, 'postcard', 0.95),
new RawClaim(DcTerms::SUBJECT->value, 'boardwalk', 0.9),
new RawClaim(DcTerms::SUBJECT->value, 'seaside', 0.8),
new RawClaim('ssai:has_text', true, 1.0),
];
$run = $ingestor->record(
scope: 'tenant:rhs',
subjectType: 'image',
subjectId: $image->getId(),
source: '[email protected]',
rawClaims: $rawClaims,
);
$em->flush();