Greek language support on Azure Text Analytics API for sentiment analysis

Just a week ago, it was announced that Azure Text Analytics API has added 16 more languages that can be parsed for sentiment analysis, Greek language being one of them (currently in preview). So, I thought I could give it a try to see how well it’s working with some random Greek phrases. Well, I have to say that the outcome was pretty neat!

If you want to give Azure Analytics Text API a shot for yourself, check here for an easy way to test it via a simple browser demo. Otherwise, if you want to get your hands dirty and write some code, check here for the quick-start process to get it working. Basically, you will need to navigate to the Azure portal, get a text analytics key (you can use the free tier just to get started) and then run a simple piece of code for a POST request to the text analytics sentiment endpoint. Free tier allows you to do 5000 transactions/month which is really convenient. Moreover, do not forget to check here for the detailed API documentation of the sentiment analysis API.

So, let’s cut to the chase! Here is a Node.js script to call the sentiment analysis API for a simple JSON file

As sample data, we will use the following JSON file. This file contains real data from ParkAround’s airport parking lot reviews.

Output from the Node.js script will be

  • Δυσκολεύομαι να πιστέψω ότι υπάρχουν πράγματα που λειτουργούν τέλεια στην Ελλάδα. Ευχαριστώ και συγχαρητήρια για την προσπάθειά σας! has a sentiment of 0.99655755
  • Όλα καλά. Ευχαριστώ πολύ!! has a sentiment of 0.9814104
  • Πολύ καλή εξυπηρέτηση. Άμεσοι, φιλικοί και πολύ πρόθυμοι Εξαιρετική επιλογή και σε πολύ καλή τιμή! has a sentiment of 1
  • Για την πληρωμή έπρεπε να πάω στο κεντρικό ταμείο και όχι στα αυτόματα μηχανήματα πληρωμών, όπου θα πλήρωνα μεγαλύτερο ποσό όπως με
    ενημέρωσε η ταμίας. has a sentiment of 0.17022656000000003
  • Καλη τοποθεσία, Γρηγόρη εξυπηρέτηση has a sentiment of 0.65071435
    Κατά την ώρα της πληρωμής, δεν μπορούσαν να βρουν τα στοιχεία κράτησης online. has a sentiment of 0.38731345
  • Ο υπάλληλος δεν ήταν ενημερωμένος για την κράτησή μου. has a sentiment of 0.36413165000000003
  • Υπήρξε αργοπορία κατά την παραλαβή του αυτοκινήτου μου κατά 45λεπτα has a sentiment of 0.451555805

(Scores close to 1 indicate positive sentiment and scores close to 0 indicate negative sentiment).

If you know Greek you can see that results are quite good for correctly spelled sentences (if you don’t know Greek, you can take my word for it!). Worth mentioning is the fact that you can submit more phrases (“documents”), up to 1000 ones with a maximum total input size of 1 MB. If you have any feedback for the team, you can leave it here.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s