Recent_Reviews_Summarization

InfoGenerateCreated ByPackages

This SQL query retrieves the 20 most recent reviews from the 'reviews' table, ordered by their 'created_at' timestamp in descending order. For each retrieved review, it uses the SNOWFLAKE.CORTEX.COMPLETE() function with the 'mistral-large' language model to generate a summarized version of the review text. The review text is passed to the function with placeholder tags '' and '' surrounding the actual content from the 'content' column.

SELECT SNOWFLAKE.CORTEX.COMPLETE(
    'mistral-large',
    CONCAT('Summarize this review: <review>', content, '</review>')
) FROM reviews ORDER BY created_at DESC LIMIT 20;