PHP code example of mohamedsaad / ai-bridge

1. Go to this page and download the library: Download mohamedsaad/ai-bridge 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/ */

    

mohamedsaad / ai-bridge example snippets


use Saad\AiBridge\AiService;

$ai = app(AiService::class);

$score = $ai->similarity("I love programming", "I enjoy coding");

echo $score; // 0.85 (the closer to 1, the more similar)

use Facades\Ai;

$score = Ai::similarity("Laravel is great", "I like PHP frameworks");

dd($score);