Home    About    Travel Chat Bot    API    Privacy

API


Sentiment Analysis API

This is a API that analyzes a hotel review sentence. It returns the features detected, and the positive or negative sentiment for each feature. For example "Room was large, but water pressure was poor." , it detects that the word "Room" was carrying a positive sentiment, caused by the adjective "large", and the "water pressure"  is carrying a negative sentiment affected by the adjective "poor".

Endpoint:  http://www.HotelSearchFreeText.com/api/Sentiment
Method:
POST
Request
 review sentence
Request format:
application/json
Response
sentiment  response object
Response format
json object



Sample Request:

curl -X POST \
http://www.HotelSearchFreeText.com/api/Sentiment \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '"room was large, but water pressure was poor"'

Response:

{
   "sentence": "room was large, but water pressure was poor",
   "lAnalyzedWords": [
      {
         "wordVector": "room",
         "sentimentValue": 1,
         "affectedBy": "large"
      },
      {
         "wordVector": "was",
         "sentimentValue": 0,
         "affectedBy": null
      },
      {
         "wordVector": "large",
         "sentimentValue": 1,
         "affectedBy": null
      },
      {
         "wordVector": ",",
         "sentimentValue": 0,
         "affectedBy": null
      },
      {
         "wordVector": "but",
         "sentimentValue": 0,
         "affectedBy": null
      },
      {
         "wordVector": "water pressure",
         "sentimentValue": -1,
         "affectedBy": "poor"
      },
      {
         "wordVector": "was",
         "sentimentValue": 0,
         "affectedBy": null
      },
      {
         "wordVector": "poor",
         "sentimentValue": -1,
         "affectedBy": null
      }
   ]
}