PHP code example of truesocialmetrics / sentiment-analysis

1. Go to this page and download the library: Download truesocialmetrics/sentiment-analysis 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/ */

    

truesocialmetrics / sentiment-analysis example snippets



// Include composer autoloader file.
 default configuration.
$analyzer = SentimentAnalysis\Analyzer::withDefaultConfig();

// Analyze the text.
$result = $analyzer->analyze('This PHP package is awesome');

// Get and print the category.
echo $result->category();