library sentiment-analysis
Sentiment analysis library for PHP.
risan/sentiment-analysis
Sentiment analysis library for PHP.
- Friday, March 11, 2016
- by risan
- Repository
- 1 Watchers
- 16 Stars
- 690 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 4 Forks
- 0 Open issues
- 2 Versions
- 25 % Grown
Sentiment Analysis
PHP Sentiment analysis library for classifying text into positive, negative, or neutral., (*1)
Installation
To install this library using Composer, run the following command inside your project directory:, (*2)
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();