greenpeace / gpi-tl-hermes

News Aggregations and Sentiment Analysis app
2 stars 0 forks source link

Toolset for GNL API #10

Closed krauthex closed 5 years ago

krauthex commented 5 years ago

Toolset for Google Natural Language API

Description

Google provides neat examples on how to interact with the Natural Language API and its content classification methods. To suit our needs we need to condense these examples to produce a json-like output, which can be directly fed into the Realtime Database and hence also into BigQuery.

Proposal

Using the examples found online to create a toolset consisting of:

  1. analyse -> return overall and sentence-wise sentiment and magnitude
  2. classify -> return the content classification, i.e. content category, like societal issue
  3. jsonify -> helper function to condense the above output into a json-like object

How to test the implementation

Call the functions, stick the result into the Realtime DB and thus also into BigQuery. If everything goes right, the test succeeded.

Related Issues

7 #4