PHP code example of coxlr / laravel-natural-language

1. Go to this page and download the library: Download coxlr/laravel-natural-language 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/ */

    

coxlr / laravel-natural-language example snippets


return [
    /*
    |--------------------------------------------------------------------------
    | The id of project created in the Google Cloud Platform console.
    |--------------------------------------------------------------------------
    */
    'project_id' => env('NATURAL_LANGUAGE_PROJECT_ID', 'sample-12345'),

    /*
    |--------------------------------------------------------------------------
    | Path to the json file containing the authentication credentials.
    |--------------------------------------------------------------------------
    */
    'key_file_path' => base_path('composer.json'),
];

NaturalLanguage::sentiment(string $text): array

NaturalLanguage::entities(string $text): array

NaturalLanguage::entitySentiment(string $text): array

NaturalLanguage::syntax(string $text): array

NaturalLanguage::categories(string $text): array

NaturalLanguage::annotateText(string $text, array $features = ['sentiment', 'syntax']): array
bash
php artisan vendor:publish --provider="Coxlr\NaturalLanguage\NaturalLanguageServiceProvider"