Prompt Challenges

🟢

Language Detection

WarmPrompt 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:

  1. Accurately identify the primary language of a text.
  2. Detect various languages in mixed-language texts.
  3. Identify dialects and variants (e.g., Simplified Chinese vs. Traditional Chinese).
  4. Process texts containing special characters and symbols.
  5. 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

  1. For each test case, use your prompt as input.
  2. 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.
  3. Compare the detection results with standard answers.
  4. Check the accuracy of identifying various languages in multilingual texts.
  5. Evaluate the handling of special characters and symbols.
  6. 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