我已经安装了laravel,但我不知道如何使用这个语法,因为我是新用户使用https://github.com/AntoineAugusti/laravel-sentiment-analysis。如何将代码放到控制器、路由和.blade中?
发布于 2019-10-15 15:29:23
按照存储库中给出的安装说明进行操作:Laravel Sentiment Analysis : Installation
使用方法:
use SentimentAnalysis;
$sentiment = new SentimentAnalysis();
// returns true or false
$sentiment->isPositive('your sentence string here');
// returns string: 'positive', 'neutral', 'negative'
$sentiment->decision('your sentence string here');您可以在SentimentAnalysisTest.php的测试实现中查看更多示例
https://stackoverflow.com/questions/58389006
复制相似问题