5.2.2. Language Detection and Custom Features
Language Detection Deep Dive: Language detection is often the FIRST step in multilingual NLP pipelines.
Language Detection returns THREE values:
- Language Name (e.g., "English", "French", "Spanish")
- ISO 639-1 Code (e.g., "en", "fr", "es")
- Confidence Score (0 to 1, where 1 is most confident)
Example response:
{
"languageName": "English",
"iso6391Name": "en",
"confidenceScore": 0.99
}
⚠️ Exam Trap: If language detection returns "Unknown" as the language name, the confidence score is "NaN" (Not a Number). This happens when the service cannot determine the language with any confidence.
Conversational Language Understanding (CLU): CLU lets you build custom natural language understanding for conversational applications like chatbots. You define:
- Intents: What the user wants to do (e.g., "BookFlight", "CheckWeather")
- Entities: Key information to extract (e.g., destination, date)
⚠️ Exam Tip: CLU is for building CUSTOM language understanding. If you need general-purpose NLP (sentiment, entities), use the pre-built features. If you need to understand YOUR specific intents and terminology, use CLU.