Print(e.name, e.entity_type, e.metadata, e.salience) Print(sentiment.score, sentiment.magnitude) Sentiment, entities = language_analysis(example_text) Sent_analysis = document.analyze_sentiment()Įnt_analysis = document.analyze_entities()Įxample_text = 'Python is such a great programming language' For example: from google.cloud import languageĭocument = client.document_from_text(text) We're going to focus on the entity recognition and sentiment analysis, but you can also do syntactical analysis with this API.Īs usual, you will need to both enable this API and of course have the API credentials setup as we did in Part 2.įrom here, things should begin to look familiar with the APIs, for example we'll have client = language.Client(), and then we'll get all sorts of methods that we can do with some input, which, in this case, will be text. In this part, we're going to explore some of the Natural Language API. Welcome to part 4 of the Google Cloud tutorial series.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |