aaltay commented on a change in pull request #11776:
URL: https://github.com/apache/beam/pull/11776#discussion_r430863465



##########
File path: sdks/python/apache_beam/examples/snippets/snippets.py
##########
@@ -1520,3 +1528,90 @@ def bigqueryio_deadletter():
   # [END BigQueryIODeadLetter]
 
   return result
+
+
+def extract_sentiments(response):
+  # [START nlp_extract_sentiments]
+  return {
+      'sentences': [{
+          sentence.text.content: sentence.sentiment.score
+      } for sentence in response.sentences],
+      'document_sentiment': response.document_sentiment.score,
+  }
+

Review comment:
       Could you remove trailing empty lines?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to