Sentiment analysis with LLMs/BQML over your data

Google Cloud TechAbout 3 min readMay 8, 2025Watch original
THE SUMMARYAI-generated

Key Concepts:

  • BigQuery: Google's fully-managed, serverless data warehouse.
  • Gemini Models: Google's family of multimodal AI models.
  • AI.GENERATE_TEXT function: BigQuery function to call Gemini models directly on data within BigQuery.
  • Sentiment Analysis: Determining the emotional tone (positive, negative, neutral) expressed in text.
  • ETL: Extract, Transform, Load - the process of moving data from various sources into a data warehouse.

Analyzing Customer Feedback with Gemini Models in BigQuery

The core problem addressed is the difficulty in extracting value from customer feedback stored in BigQuery, leading to missed insights and inefficient routing of feedback to relevant teams (customer service, product development, logistics). The solution presented is using Gemini models directly within BigQuery via the AI.GENERATE_TEXT function. This eliminates the need for ETL processes, allowing for real-time analysis of feedback where it resides.

Practical Application: Product Review Sentiment Analysis

The video demonstrates a specific use case: analyzing product reviews to determine sentiment across different aspects of the customer experience.

  1. Data Source: A BigQuery table containing hundreds of plain text product reviews.
  2. Gemini Model Integration: The AI.GENERATE_TEXT function is used to call a Gemini model.
  3. Prompt Engineering: The prompt is crucial. It specifies:
    • The column containing the review text (review column).
    • The desired output structure (schema).
    • The aspects to analyze (product quality, shipping, customer service).
    • The type of analysis (sentiment detection).
  4. Example Review Analysis: For a review of a "20-gal aquarium," the model detected negative sentiment related to shipping and customer service. The specific issues identified were damaged and late shipment, and poor customer service.
  5. Actionable Insights: The negative shipping sentiment triggers routing the review to the logistics team.
  6. Further Analysis: The video suggests using Gemini models again to summarize the most common issues across all reviews with negative shipping sentiment.

Benefits and Advantages

  • No ETL: Eliminates the complexity and time associated with moving data out of BigQuery for analysis.
  • Faster Insights: Automates the process of tagging and analyzing feedback, reducing manual effort and bottlenecks.
  • Targeted Routing: Enables routing specific feedback to the appropriate teams based on the identified issues.
  • Scalability: Leverages the scalability of BigQuery and Gemini models to handle large volumes of customer feedback.

Conclusion

The video highlights the power of using Gemini models directly within BigQuery to analyze customer feedback. By using the AI.GENERATE_TEXT function and well-crafted prompts, businesses can automate sentiment analysis, identify key issues, and route feedback to the right teams, leading to faster insights and improved customer experiences. The key takeaway is the ability to perform complex AI-powered analysis without the need for traditional ETL processes, unlocking the value hidden within customer feedback data.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.