<?php
$tinq = new Tinq\TinqClient('<your_api_key>');
$reviews = [
'The apartment was as advertised and Frank was incredibly helpful through the entire process.',
'This was the worse experience that I had on this app. Trully disapointing',
'This is really a great location. The street is quiet and the room is really great. The bed is confortable. Terry is really helpfull. Enjoy.',
'It was decent. Nothing more to add.',
];
$analysis = [];
foreach($reviews as $review) {
$sentimentAnalysis = $tinq->sentiments($review);
$sentiment = $sentimentAnalysis['sentiment'];
$analysis[] = [
'review' => $review,
'sentiment' => $sentiment
];
}
var_dump($analysis);