risan / sentiment-analysis
Sentiment analysis library for PHP.
Installs: 3 543
Dependents: 0
Suggesters: 0
Security: 0
Stars: 20
Watchers: 3
Forks: 8
Open Issues: 0
Requires (Dev)
- phpunit/phpunit: ~4.8
This package is auto-updated.
Last update: 2024-12-17 21:11:36 UTC
README
PHP Sentiment analysis library for classifying text into positive, negative, or neutral.
Installation
To install this library using Composer, run the following command inside your project directory:
composer require risan/sentiment-analysis
Basic Usage
<?php // Include composer autoloader file. require __DIR__ . '/vendor/autoload.php'; // Create a new instance of analyzer with 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();