英語プロンプトの精度を高める技術:動詞・前置詞・冠詞の的確な使い分け
この記事は、AIへの指示の核となる動詞、前置詞、冠詞の使い方を掘り下げ、プロンプトの質をさらに一段階引き上げることを目指します。
1. 指示の意図を明確にする動詞の使い分け
同じ「作る」というタスクでも、Create
とGenerate
ではAIが受け取るニュアンスが異なります。ここでは、似た意味を持つ動詞を比較し、それぞれの動詞が持つ意図を明確にしていきます。
Create
vs Generate
vs Write
vs Build
🔹 カテゴリ1: 生成 (Creation) - 動詞 | コアとなるニュアンス | 効果的な場面 | 例文 |
---|---|---|---|
Create | 最も汎用的で標準的。ゼロから何かを作ること。 | 関数、ファイル、クラス、簡単なオブジェクトの作成 | Create a Python function that calculates the factorial of a number. |
Generate | 創造性やパターン。AIにアイデアや多様な出力を求める。 | テストデータ、ダミーテキスト、アイデアリスト、正規表現 | Generate 10 realistic test cases for the login function, including edge cases. |
Write | 書き物。コード、ドキュメント、メールなど文章が主体のもの。 | READMEファイル、コードコメント、ユニットテストのコード | Write a docstring for this function that explains its parameters and return value. |
Build | 組み立て。複数の要素を組み合わせる複雑な構造物。 | GUIアプリのレイアウト、プロジェクトのディレクトリ構造 | Build a simple GUI calculator using Tkinter with standard arithmetic buttons. |
Explain
vs Describe
vs Summarize
🔹 カテゴリ2: 説明 (Explanation) - 動詞 | コアとなるニュアンス | 効果的な場面 | 例文 |
---|---|---|---|
Explain | 理由や仕組み (Why/How)。背景にあるロジックを問う。 | アルゴリズムの動作原理、エラーの原因究明 | Explain why this recursive function causes a stack overflow with large inputs. |
Describe | 客観的な描写 (What)。見たままの状態や特徴を列挙。 | コードが何をしているかの表面的な説明、APIのエンドポイント一覧 | Describe what this block of code does, line by line. |
Summarize | 要点。情報を圧縮し、最も重要な部分を抽出。 | 長い記事の要約、複雑なエラーログの核心部分の特定 | Summarize this technical article in three bullet points for a project manager. |
Convert
vs Transform
vs Refactor
🔹 カテゴリ3: 変換 (Transformation) - 動詞 | コアとなるニュアンス | 効果的な場面 | 例文 |
---|---|---|---|
Convert | 形式の変換。データの本質は変えずにフォーマットを変える。 | JSONからCSVへ、PythonコードからJavaScriptコードへ | Convert this Python dictionary into a JSON string. |
Transform | 構造の変換。データの内容や構造自体を整形・加工する。 | 生データをクレンジング、特定の形式にデータをマッピング | Transform this list of user objects to a dictionary grouped by country. |
Refactor | コードの内部改善。外部から見た振る舞いは変えずに品質を向上させる。 | 読みにくいコードの可読性向上、パフォーマンス改善 | Refactor this nested loop to use a more efficient list comprehension. |
2. 動詞の意図を詳細に伝える前置詞の使い方
動詞が「何をするか」を示すのに対し、前置詞は「何のために、何を使って、どの方向に」といった詳細な条件を指定する役割を果たします。目的別に使い方を整理しましょう。
for
目的 (For what?) - タスクのゴールを明確に示します。
- Optimize this query for faster response times. (より速い応答時間のために)
- Refactor this component for better reusability. (より良い再利用性のために)
by
, with
, using
手段 (By what? / With what? / Using what?) - タスクを達成するための具体的な方法やツールを指定します。
- Sort the user list by their registration date. (登録日によって)
- Create a bar chart with the given data. (与えられたデータで)
- Build a REST API using the Flask framework. (Flaskフレームワークを使って)
from
, to
, into
変換元/先 (From/To/Into) - データの流れや変化の方向を定義します。
- Extract the user names from this raw text. (この生テキストから)
- Translate the comments from Japanese to English. (日本語から英語へ)
- Convert the string into a JSON object. (JSONオブジェクトの中へ)
in
, as
形式 (In what format?) - アウトプットの形式を指定します。
- Output the results in a markdown table format. (マークダウンの表形式で)
- Return the value as a boolean. (ブール値として)
【応用例文】
一つのプロンプトに複数の前置詞を組み合わせることで、より高精度な指示が可能になります。
複数の前置詞を使った指示の例
Refactor this Python script for readability by converting the for
loops into list comprehensions and add type hints for all function arguments.
3. 指示の「特定性」を制御する冠詞 (a/the) の使い方
a
(不特定) と the
(特定) の使い分けは、AIとの対話において、指示の具体性を調整する重要な役割を持ちます。
a
アプローチ1: 自由度を与える AIに選択肢や創造性の余地を残したい場合に使います。
- Generate a creative function name for a script that processes images.
- (AIに文脈から最適な名前を考えさせます)
- Write a unit test for this function.
- (具体的なテストケースはAIに任せるという意図が伝わります)
※補足:「a」は文法的には「不特定」を示しますが、手順書やAIへの指示では
「新規にこれから作るもの」を意味することが多く、実用上はこちらの理解が自然です。
the
アプローチ2: 厳密に指定する 前の会話や文脈に登場した特定の対象を指し示し、誤解を避けたい場合に使います。
- (前の応答でエラーメッセージが出た後...)
Explain the error message above in detail.- (他のエラーではなく、今話題にしている「その」エラーについて説明するよう指示します)
アプローチ3: 固有名詞による直接指定
最も確実なのは、冠詞に頼らず固有名詞で直接指定することです。これにより、AIの解釈の揺れを最小限に抑えられます。
【対話例】
User: Create a file and put some text in it. (曖昧)
AI: Okay, I have created a file named "file.txt" and put the text "some text" in it. Is this correct?
User (改善後): Create a file named "log.txt". Append the current timestamp to "log.txt". (明確)
4. 用途別クイックリファレンス
やりたいこと | 推奨される「動詞 + 前置詞」の組み合わせ |
---|---|
ゼロからコードを作りたい |
Create a function for... , Write a script in [language] that... , Generate a class with...
|
既存コードを改善したい |
Refactor this code for readability , Optimize this algorithm by... , Debug this function and identify the bug in...
|
データの形を変えたい |
Convert this data from [format] to [format] , Transform this list into a dictionary , Format the output in JSON
|
何かを理解したい |
Explain the difference between A and B , Describe the workflow of... , Summarize the key points from this text
|
リストアップしてほしい |
List all dependencies for... , List the steps to... , Identify potential issues in this code
|
✅ 結論
本記事で解説した動詞のニュアンス、前置詞の組み合わせ、冠詞の使い方を意識することで、AIはあなたの意図をより忠実に反映した、質の高いアウトプットを返す、さらに有能なアシスタントとなるでしょう。
Discussion