Python 100 project #14: Google Cloud Natural Language API

This is more like a introduction of Google Cloud Natural Language API.

I’m trying to scrape the drama transcript from the web, and want to visualize them. In the past project, I’ve used wordcloud quite often, but it merely count the frequency of the word appeared in the sentence. it is of course very big factor to know the importance of that word. I’m going to use Cloud Natural Language API to compare those two result, and hopefully I can find the new things of my favourite dramas.

Usually, I use the third party library if there exists, and this google cloud natural language also has a python library called google-cloud-python. But this time I use simple requests to see how the raw transaction looks like.

 

[ analyzeEntities ]

 

[ analyzeSentiment ]

 

It is interesting as the word ‘relay device’ has the salience value of 0.5245988, though the frequency is still the same as the other words. It should be very interesting if I gather all these result from whole Dr. Who episodes.