π§ What is Custom Question Answering?
Custom Question Answering (CQA) is a feature under Azure AI Language Service that allows you to build a knowledge-based Q&A system. Instead of writing code or training ML models, you simply provide documents or URLs β Azure does the rest.
Think of it like building your own version of ChatGPT β but trained on your company’s internal documents, policies, FAQs, or even PDFs.
π¦ What Youβll Build
A simple Question Answering model that:
- Ingests your documents (PDFs, Word, or URLs)
- Extracts Q&A pairs using Azure’s built-in AI
- Can be queried through a web interface or REST API
π§° Prerequisites
- An Azure subscription
- Contributor/Owner access to create resources
- Some personal documents to test with (PDFs, FAQs, etc.)
π Step-by-Step Setup
πΉ Step 1: Create an Azure AI Language Resource
- Go to Azure Portal
- Search for Language and choose Azure AI Language
- Click Create
- Fill in the basics:
- Subscription & Resource Group
- Region: e.g., East US
- Name:
language-cqa-demo - Pricing Tier: Choose F0 (Free) or S tier
- Click Review + Create β then Create
πΉ Step 2: Create a Custom Question Answering Project
- Go to the Language Studio
- Sign in with the same Azure account
- Click Custom Question Answering under the “Build” section
- Choose your newly created resource
- Click + New Project
- Project Name:
faq-ai-bot - Language: English
- Description: βMy first custom AI botβ
- Click Create
- Project Name:
πΉ Step 3: Add Knowledge Sources
You can add sources by:
π Uploading files:
- PDFs, DOCX, TXT files
- Click + Add Source β Files
- Upload your own company FAQ or document
π Adding URLs:
- Add a webpage (like your company policy or GitHub Wiki)
- Language Studio will auto-scrape Q&A pairs
βοΈ Manual Q&A:
- Add custom question-answer pairs directly
- Helpful for adding targeted responses
πΉ Step 4: Train the Project
- Once your sources are added, click Train
- Wait a few seconds β training is fast!
- Youβll get a notification when training completes
πΉ Step 5: Test Your Model
- Go to the Test tab
- Ask questions based on your content:
- βWhat is our refund policy?β
- βHow do I reset my password?β
- See how your model responds!
- Tweak answers as needed by editing the extracted Q&A pairs
πΉ Step 6: Deploy the Project
- Click the Deploy tab
- Click Deploy project
- This will create a public endpoint and assign a deployment name (e.g.,
faq-bot-prod)
π Using the API
Once deployed, you can call your Q&A bot via REST API:
POST https://<your-resource-name>.cognitiveservices.azure.com/language/:query-knowledgebases?projectName=faq-ai-bot&deploymentName=faq-bot-prod&api-version=2021-10-01
Add headers:
Ocp-Apim-Subscription-Key: <your-key>
Content-Type: application/json
And body:
{
"question": "How do I reset my password?"
}
π‘ Real World Use Cases
- Internal IT helpdesk bot
- HR FAQ bot for employees
- Customer service agent for common questions
- Secure chatbot trained on policy docs
π Resources
- Get started with Azure Cognitive Services for Language
- What is custom question answering?
- Azure AI Language pricing
- Tutorial: Create a FAQ bot
π§ Final Thoughts
If you’re new to Azure or AI, this is a perfect hands-on start. No code, no hassle β just smart responses powered by your own data.