A development team wants to have generative AI write the corresponding source code from comments written in natural language (what they want to do). Which generative AI use case does this purpose fall under?

1 / 1
Select an answer
CorrectB

Explanation

Select the generative AI use case that makes source code from natural language.

  • 1comments written in natural languageInstruct in words what you want to do
  • 2the corresponding source codeGenerate code = code generation
AIncorrect

Code summarization

Code summarization is a use case that reads existing source code and explains what it does in natural language (code → natural language).

This question is the reverse direction, generating source code from natural language comments (natural language → code); the direction of input and output is reversed, so it is incorrect.

BCorrect

Code generation

This is correct. Code generation is a generative AI use case that generates the corresponding source code from natural-language instructions or comments. Tools such as Amazon Q Developer apply.

CIncorrect

Text classification

Text classification is a use case that sorts text into predefined categories (for example, automatically sorting inquiry emails into 'billing,' 'technical,' and so on).

It is for applying labels to text, not for newly generating source code, so it is incorrect.

DIncorrect

Machine translation

Machine translation is a use case that converts text in one language into another language (for example, translating an English document into Japanese).

It is for converting text between languages, not for generating source code from natural language, so it is incorrect.

Key Takeaway

Remember the characteristics of the correct answer, 'code generation.'
- Generates the corresponding source code from natural-language instructions or comments (natural language → code).
- Tools such as Amazon Q Developer raise development productivity.
Distinguish from confusing text use cases by direction and purpose.
- Code summarization: code → natural-language explanation (reverse direction).
- Text classification: sorts text into categories (not generation).
- Machine translation: converts a sentence in one language into another language (does not make code).