Skip to content

sentiment_score

sentiment_score(content)

Description

Compute sentiment score of content

Usage

Call or Deploy sentiment_score ?
Call sentiment_score directly

The easiest way to use bigfunctions

  • sentiment_score function is deployed in 39 public datasets for all of the 39 BigQuery regions.
  • It can be called by anyone. Just copy / paste examples below in your BigQuery console. It just works!
  • (You need to use the dataset in the same region as your datasets otherwise you may have a function not found error)

Public BigFunctions Datasets

Region Dataset
eu bigfunctions.eu
us bigfunctions.us
europe-west1 bigfunctions.europe_west1
asia-east1 bigfunctions.asia_east1
... ...
Deploy sentiment_score in your project

Why deploy?

  • You may prefer to deploy sentiment_score in your own project to build and manage your own catalog of functions.
  • This is particularly useful if you want to create private functions (for example calling your internal APIs).
  • Get started by reading the framework page

Deployment

sentiment_score function can be deployed with:

pip install bigfunctions
bigfun get sentiment_score
bigfun deploy sentiment_score

Examples

select bigfunctions.eu.sentiment_score("BigFunctions Rocks!")
select bigfunctions.us.sentiment_score("BigFunctions Rocks!")
select bigfunctions.europe_west1.sentiment_score("BigFunctions Rocks!")
+-----------------+
| sentiment_score |
+-----------------+
| 0.945           |
+-----------------+

Use cases

A company wants to analyze customer feedback left on their website. They store the feedback text in a BigQuery table called customer_feedback. They can use the sentiment_score function to determine the sentiment (positive, negative, or neutral) of each feedback entry.

SELECT
    feedback_id,
    feedback_text,
    bigfunctions.us.sentiment_score(feedback_text) AS sentiment_score
  FROM
    `your-project.your_dataset.customer_feedback`

This query adds a new column called sentiment_score to the table. This score will be a numerical value indicating the sentiment. A higher score indicates more positive sentiment, while a lower score indicates more negative sentiment. They can then use this score to:

  • Identify trends: Track changes in overall customer sentiment over time.
  • Categorize feedback: Group feedback into positive, negative, and neutral categories for easier analysis.
  • Prioritize responses: Address negative feedback first to mitigate customer dissatisfaction.
  • Measure campaign effectiveness: Analyze sentiment before and after a marketing campaign to gauge its impact.
  • Improve products/services: Identify areas where customers express negative sentiment and use that information to make improvements.

By applying this function to their existing feedback data, the company can gain valuable insights into customer opinions and make data-driven decisions to improve their business.


Need help or Found a bug?
Get help using sentiment_score

The community can help! Engage the conversation on Slack

We also provide professional suppport.

Report a bug about sentiment_score

If the function does not work as expected, please

  • report a bug so that it can be improved.
  • or open the discussion with the community on Slack.

We also provide professional suppport.


Show your ❤ by adding a ⭐ on