Back to List
Warm
🟢
Language Detection
Warm • Prompt Engineering Challenge
Identify the language of given text
Challenge Description
Language detection is a fundamental task in natural language processing, used to identify the language(s) used in text. This challenge requires you to write a prompt that enables AI to accurately identify the language of text, and handle cases involving multilingual mixtures, dialect variants, and special characters.
Challenge Goals
Write a prompt that enables AI to:
- Accurately identify the primary language of a text.
- Detect various languages in mixed-language texts.
- Identify dialects and variants (e.g., Simplified Chinese vs. Traditional Chinese).
- Process texts containing special characters and symbols.
- Provide a confidence score and a reason for the detection.
Requirements
- The detection result must include the main language, confidence, and reason for detection.
- For multilingual texts, list all detected languages and their proportions.
- Confidence must be an integer from 0-100.
- The reason for detection must be concise (no more than 50 characters).
- The output format must be uniform and easy to parse.
Prompt Template
[Your Prompt]
Text: {Text Content}
Automated Testing Process
- For each test case, use your prompt as input.
- Analyze whether the output includes:
- A list of detected languages.
- A confidence score from 0-100.
- A reason for detection of no more than 50 characters.
- Compare the detection results with standard answers.
- Check the accuracy of identifying various languages in multilingual texts.
- Evaluate the handling of special characters and symbols.
- Calculate the final score (out of 10 points).
Expected Output Example (for Case 4)
Language Detection Result:
- Main Language: English (40%)
- Other Languages: Chinese (20%), French (20%), Japanese (20%)
- Confidence: 85%
- Reason for Detection: Contains greetings in English, Chinese, French, and Japanese, with similar proportions for each.
Detailed Analysis:
- "Hello\!" - English
- "你好!" - Chinese
- "Bonjour\!" - French
- "こんにちは!" - Japanese
<!-- end list -->
Submit your solution and share your ideas and techniques with the community!
Write Your Prompt
Write your AI prompt based on the requirements
0 / 2000
Tips for Better Prompts
- Be specific and clear about what you want
- Provide context and examples when helpful
- Use appropriate tone and style for your audience
- Test and iterate to improve your results
Need help? Join our community
View Discussions