This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Data warehouses traditionally focus on structured and semi-structured data. Free-form text such as notes, logs, or comments was difficult to process in data warehousing scenarios without external components.
Microsoft Fabric Data Warehouse is opening new scenarios in modern data warehousing by enabling you to work with unstructured text using new AI capabilities.
We are introducing built-in AI functions that enable extraction, classification, sentiment analysis, and transformation of unstructured text. In addition to this, the AI functionalities enable you to use custom prompt-based processing directly in T-SQL language.
In this article, you will learn about these new capabilities that are in preview.
SQL_query_selecting_patient_s_medial_notes_and_extracting_symptoms_diagnosis_and
SQL_query_selecting_patient_s_medial_notes_and_extracting_symptoms_diagnosis_and
Figures 1-2. Extracting details from medical notes.
This function will extract the required topics from the text and return them as a set of JSON properties. The extraction relies on contextual interpretation rather than complex rules or regular expressions.
SELECT CommentId, CommentText,
ai_analyze_sentiment(CommentText) AS Sentiment
FROM Feedback;
Based on text content, the function will categorize the sentiment of text as positive, negative, neutral, or mixed.
INSERT INTO silver.Logs (LogTime, LogMessage, Category)
SELECT LogTime, LogMessage,
ai_classify(LogMessage, 'UI','wrong result','performance','timeout') AS Category
FROM OPENROWSET(‘/Files/logs/*.jsonl’, DATA_SOURCE=’AppLogLakehouse’);
The ai_classify() function will pick one category that is contextually most like the input text and return it as a result. This value is ingested as an additional category column in the target table. This might be extremely helpful for labeling and categorizing new inputs.
UPDATE Tickets
SET Summary = ai_summarize(Description),
Description = ai_fix_grammar(Description),
SpanishDescription = ai_translate(Description,'es')
FROM Tickets;
These functions enable standard text processing tasks grammar correction, summarization, and translation, which you might typically perform in the application layer. However, using these AI functions within the data warehouse allows you to apply them at scale, processing large volumes of records directly within your tables, something that is not easily achievable at the application layer without complex integration and orchestration.
As an example, you can customize extraction of information from incident text:
CREATE OR ALTER FUNCTION dbo.analyze_incident( @incident_text VARCHAR(8000) )
RETURNS VARCHAR(8000) AS BEGIN
RETURN
ai_generate_response('Analyze the incident and return a concise JSON with root_cause, immediate_action, and owner_team. Use short technical explanations to avoid quoting the text. Incident: ', @incident_text )
)
END;
Once you create this kind of function, you can call it from any query and apply the logic defined in prompt on input text. As a best practice, you should encapsulate your prompt in T-SQL function or procedure and invoke it as a separate module.
To learn more, refer to the documentation: Use AI functions in Fabric Data Warehouse.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.