> ## Documentation Index
> Fetch the complete documentation index at: https://prompt.university/llms.txt
> Use this file to discover all available pages before exploring further.

# Module 2: Task-Specific Prompting Patterns

> Master proven patterns for classification, extraction, generation, transformation, and QA tasks

<Info>
  **Duration:** 4-5 hours | **Difficulty:** Intermediate
</Info>

## Module Overview

Now that you understand the fundamentals, it's time to apply them across different NLP tasks. Each task type has patterns that work exceptionally well. You'll learn proven templates and techniques for classification, information extraction, generation, transformation, and question-answering tasks.

## Learning Objectives

By the end of this module, you will be able to:

<Check>Design effective prompts for text classification tasks</Check>
<Check>Extract structured information from unstructured text</Check>
<Check>Generate creative and functional content with constraints</Check>
<Check>Transform text across styles, formats, and languages</Check>
<Check>Build robust question-answering systems</Check>

## Why Task-Specific Patterns Matter

Different tasks require different approaches:

* **Classification** needs constrained outputs
* **Extraction** benefits from progressive techniques
* **Generation** requires clear constraints and attributes
* **Transformation** balances fidelity with adaptation
* **QA** demands structured reasoning

Understanding these patterns accelerates your prompting effectiveness across any domain.

## Module Lessons

<CardGroup cols={2}>
  <Card title="Lesson 2.1: Text Classification" icon="tags" href="/module-2/lesson-1">
    Extract reliable classifications from text-generating LLMs
  </Card>

  <Card title="Lesson 2.2: Information Extraction" icon="magnifying-glass" href="/module-2/lesson-2">
    Pull structured data from unstructured text
  </Card>

  <Card title="Lesson 2.3: Text Generation" icon="wand-magic-sparkles" href="/module-2/lesson-3">
    Create content with specific constraints and attributes
  </Card>

  <Card title="Lesson 2.4: Text Transformation" icon="arrows-spin" href="/module-2/lesson-4">
    Transform text across languages, styles, and formats
  </Card>

  <Card title="Lesson 2.5: Question-Answering" icon="comments-question" href="/module-2/lesson-5">
    Build robust QA systems with structured reasoning
  </Card>
</CardGroup>

## What You'll Build

Throughout this module, you'll work on practical applications:

* **Sentiment classifier** for customer reviews
* **Entity extractor** for business documents
* **Content generator** for marketing copy
* **Style transformer** for different audiences
* **QA system** for technical documentation

## Task-Pattern Quick Reference

| Task           | Best Pattern            | Key Technique                 |
| -------------- | ----------------------- | ----------------------------- |
| Classification | Constrained output      | Explicit label set            |
| NER            | Progressive extraction  | Simple → Complex              |
| Generation     | Attribute specification | Constraints + examples        |
| Transformation | Source-target clarity   | Balance fidelity & adaptation |
| QA             | Reasoning structure     | Step-by-step breakdown        |

## Prerequisites

Before starting this module, ensure you've completed:

* ✅ Module 1: Foundations of Prompting
* ✅ Understanding of the four core principles
* ✅ Familiarity with in-context learning

## Module Assessment

After completing all lessons, you'll tackle a **capstone project**: building a complete content moderation system that:

* Classifies content safety levels
* Extracts problematic elements
* Generates explanations
* Suggests modifications

<Note>
  **Estimated Time:** Each lesson takes 45-60 minutes. Plan for 4-5 hours total, plus assessment time.
</Note>

## Ready to Begin?

<Card title="Start Lesson 2.1: Text Classification Prompts" icon="play" href="/module-2/lesson-1">
  Learn how to extract reliable classifications from LLMs
</Card>
