Black Friday sale: an extra 40% off every course until Monday, November 30.New Year sale: an extra 30% off every course until Friday, January 1.Memorial Day sale: an extra 25% off every course until Monday, May 31.SysAdmin Day sale: an extra 25% off every course until Sunday, August 1.Back to School sale: an extra 25% off every course until Sunday, August 22.Labor Day sale: an extra 25% off every course until Monday, September 6.Black Friday sale: an extra 40% off every course until Monday, November 29.New Year sale: an extra 30% off every course until Saturday, January 1.Choose your certification →

Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

5.1.1. Building a Text Analysis Application

💡 First Principle: To analyze text with a generative model, you describe the analysis you want in the prompt and let the model return the result — ideally in a structured format you specify. The model is the engine; your prompt defines the task (sentiment, entities, keywords, summary) and the output shape.

The two-client pattern from Phase 4 carries over unchanged; only the input differs. You ask for a specific analysis and, for anything a program will consume, request a structured format like JSON:

response = openai_client.responses.create(
    model="gpt-5.2",  # your deployment name
    input="Classify the sentiment of this review as positive, negative, "
          "or neutral and return only that word: 'The food was cold and slow.'",
)
print(response.output_text)   # -> negative

For higher-volume or specialized needs, Azure also offers dedicated language capabilities, but at fundamentals level the key insight is that one deployed generative model can perform keyword extraction, entity detection, sentiment analysis, and summarization just by varying the prompt.

⚠️ Exam Trap: If you need the output to feed another program (not a human), ask the model for a structured format and use a low temperature for consistency. Free-form prose at high temperature is hard to parse reliably — a common wrong setup in exam scenarios.

Reflection Question: You want sentiment results you can store in a database column. What two things should your prompt and configuration ensure about the output?

See how it connects
Alvin Varughese
Written byAlvin Varughese
Founder•26 professional certifications earned