Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use Google Natural Language API to enrich data in a Bigquery table?

I want to use data stored in a BigQuery table as input to Google's Natural Language API, perform entity extraction and sentiment analysis, and persist the result back to BigQuery. What tools/services could I use to handle this in GCP? Performance is not a concern, and running this in an overnight batch would be acceptable for this use-case.

like image 818
Rich Ashworth Avatar asked Sep 20 '25 02:09

Rich Ashworth


1 Answers

This should be fairly straightforward to do with Dataflow--you could write a pipeline that reads from BigQuery followed by a DoFn that uses Google's NLP Libraries, and then writes the results to BigQuery.

Some wrappers are already provided for you in https://github.com/apache/beam/blob/master/sdks/python/apache_beam/ml/gcp/naturallanguageml.py

like image 69
robertwb Avatar answered Sep 22 '25 04:09

robertwb