Brahim Hadj - 2017-04-06 00:05:00
Please, i tried to use the PHP Sentiment analyser class, but i had this error :
Warning: Division by zero in C:\wamp\www\SIPHP\src\SentimentAnalyzer.class.php on line 106
and on line 123,131,137 and 138
this is my code :
$sat = new SentimentAnalyzerTest(new SentimentAnalyzer());
$sentence1 = 'while the performances are often engaging , this loose collection of largely improvised numbers would probably have worked better as a one-hour tv documentary . ';
$sentimentAnalysisOfSentence1 = $sat->analyzeSentence($sentence1);
$resultofAnalyzingSentence1 = $sentimentAnalysisOfSentence1['sentiment'];
$probabilityofSentence1BeingPositive = $sentimentAnalysisOfSentence1['accuracy']['positivity'];
$probabilityofSentence1BeingNegative = $sentimentAnalysisOfSentence1['accuracy']['negativity'];