From 36e169f3abe0082f872d31dc4e0bb320dc0f2a32 Mon Sep 17 00:00:00 2001 From: rasbt Date: Mon, 27 May 2024 07:13:59 -0500 Subject: [PATCH 1/8] add keys --- ch07/02_dataset-utilities/config.json | 3 +++ ch07/03_model-evaluation/config.json | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 ch07/02_dataset-utilities/config.json create mode 100644 ch07/03_model-evaluation/config.json diff --git a/ch07/02_dataset-utilities/config.json b/ch07/02_dataset-utilities/config.json new file mode 100644 index 0000000..3f41b84 --- /dev/null +++ b/ch07/02_dataset-utilities/config.json @@ -0,0 +1,3 @@ +{ + "OPENAI_API_KEY": "sk-..." +} \ No newline at end of file diff --git a/ch07/03_model-evaluation/config.json b/ch07/03_model-evaluation/config.json new file mode 100644 index 0000000..3f41b84 --- /dev/null +++ b/ch07/03_model-evaluation/config.json @@ -0,0 +1,3 @@ +{ + "OPENAI_API_KEY": "sk-..." +} \ No newline at end of file From b2ad4fb0d6d05e798e5beadf5a0c0b10ef49ad35 Mon Sep 17 00:00:00 2001 From: rasbt Date: Mon, 27 May 2024 07:18:07 -0500 Subject: [PATCH 2/8] add comment --- .gitignore | 4 ++++ ch07/02_dataset-utilities/config.json | 3 ++- ch07/03_model-evaluation/config.json | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index bd8dff2..ba38c30 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# Configs and keys +ch07/02_dataset-utilities/config.json +ch07/03_model-evaluation/config.json + # Graphics appendix-D/01_main-chapter-code/1.pdf appendix-D/01_main-chapter-code/2.pdf diff --git a/ch07/02_dataset-utilities/config.json b/ch07/02_dataset-utilities/config.json index 3f41b84..c0bdf62 100644 --- a/ch07/02_dataset-utilities/config.json +++ b/ch07/02_dataset-utilities/config.json @@ -1,3 +1,4 @@ { - "OPENAI_API_KEY": "sk-..." + "OPENAI_API_KEY": "sk-...", + "_comment": "Enter your API key from https://platform.openai.com/api-keys" } \ No newline at end of file diff --git a/ch07/03_model-evaluation/config.json b/ch07/03_model-evaluation/config.json index 3f41b84..c0bdf62 100644 --- a/ch07/03_model-evaluation/config.json +++ b/ch07/03_model-evaluation/config.json @@ -1,3 +1,4 @@ { - "OPENAI_API_KEY": "sk-..." + "OPENAI_API_KEY": "sk-...", + "_comment": "Enter your API key from https://platform.openai.com/api-keys" } \ No newline at end of file From 474ad17546b4dff1f380f7d380d9f1cbc9a0778e Mon Sep 17 00:00:00 2001 From: rasbt Date: Mon, 27 May 2024 07:29:06 -0500 Subject: [PATCH 3/8] Update API approach and add progress bar --- .../create-passive-voice-entries.ipynb | 53 +++--- .../llm-instruction-eval-openai.ipynb | 175 +++++++++--------- 2 files changed, 116 insertions(+), 112 deletions(-) diff --git a/ch07/02_dataset-utilities/create-passive-voice-entries.ipynb b/ch07/02_dataset-utilities/create-passive-voice-entries.ipynb index 45141cc..04d5b4c 100644 --- a/ch07/02_dataset-utilities/create-passive-voice-entries.ipynb +++ b/ch07/02_dataset-utilities/create-passive-voice-entries.ipynb @@ -54,7 +54,7 @@ "metadata": {}, "outputs": [], "source": [ - "# pip install -r requirements-exra.txt" + "# pip install -r requirements-extra.txt" ] }, { @@ -107,31 +107,28 @@ "id": "89343a84-0ddc-42fc-bf50-298a342b93c0", "metadata": {}, "source": [ - "- First, we need to provide our OpenAI API key, which can be found at https://platform.openai.com/api-keys\n", - "- Make sure not to share this key with anyone (make sure to delete it from this notebook in case you intend to share it; I recommend deleting the entire notebook cell that contains the key)\n", - "- Alternatively, delete the used API key from your account after you are finished to make sure it can't be abused later" + "- First, we need to provide our OpenAI API secret key, which can be found at https://platform.openai.com/api-keys\n", + "- Make sure not to share this key with anyone\n", + "- Add this secret key (`\"sk-...\"`) to the `config.json` file in this folder" ] }, { "cell_type": "code", - "execution_count": null, - "id": "8ba8760c-1635-43cf-b039-9d1557b664c4", - "metadata": {}, - "outputs": [], - "source": [ - "OPENAI_API_KEY = \"your OpenAI API key\"" - ] - }, - { - "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "id": "26900564-aba7-48ba-8ee8-6cc9a505a25c", "metadata": {}, "outputs": [], "source": [ + "import json\n", "from openai import OpenAI\n", "\n", - "client = OpenAI(api_key=OPENAI_API_KEY)" + "# Load API key from a JSON file. \n", + "# Make sure to replace \"sk-...\" with your actual API key from https://platform.openai.com/api-keys\n", + "with open(\"config.json\", \"r\") as config_file:\n", + " config = json.load(config_file)\n", + " api_key = config[\"OPENAI_API_KEY\"]\n", + "\n", + "client = OpenAI(api_key=api_key)" ] }, { @@ -144,7 +141,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "id": "08e9ef2e-e816-4283-840e-43625791ad33", "metadata": {}, "outputs": [ @@ -154,7 +151,7 @@ "'Breakfast was eaten by me.'" ] }, - "execution_count": 5, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -193,7 +190,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "id": "8b2d393a-aa92-4190-9d44-44326a6f699b", "metadata": {}, "outputs": [ @@ -226,7 +223,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "id": "735cc089-d127-480a-b39d-0782581f0c41", "metadata": {}, "outputs": [ @@ -255,7 +252,7 @@ ">> The three primary colors are red, blue, and yellow.\n", "\n", "Output:\n", - ">> Red, blue, and yellow are the three primary colors.\n", + ">> Red, blue, and yellow are considered the three primary colors.\n", "\n", "-------------------------\n", "\n", @@ -299,7 +296,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "id": "4f700d4b-19e5-4404-afa7-b0f093024232", "metadata": {}, "outputs": [ @@ -307,7 +304,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "100%|█████████████████████████████████████████████| 5/5 [00:05<00:00, 1.12s/it]\n" + "100%|██████████████████████████████████████████████████████████████████████| 5/5 [00:04<00:00, 1.23it/s]\n" ] } ], @@ -331,7 +328,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "id": "5b6eaa87-a86d-42a1-a20a-b764b0d559d4", "metadata": {}, "outputs": [ @@ -344,7 +341,7 @@ " 'output_2': 'The sentence is \"sleeps.\"'}" ] }, - "execution_count": 9, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -363,7 +360,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "id": "eef99407-8ffd-4a63-b7ab-ffe30c0f0677", "metadata": {}, "outputs": [ @@ -371,7 +368,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "100%|█████████████████████████████████████████| 200/200 [02:38<00:00, 1.26it/s]\n" + "100%|██████████████████████████████████████████████████████████████████| 200/200 [03:43<00:00, 1.12s/it]\n" ] } ], @@ -392,7 +389,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "id": "330cc30a-b08e-4bf0-bee2-bec0da4208de", "metadata": {}, "outputs": [], diff --git a/ch07/03_model-evaluation/llm-instruction-eval-openai.ipynb b/ch07/03_model-evaluation/llm-instruction-eval-openai.ipynb index 8ae44da..a7ef043 100644 --- a/ch07/03_model-evaluation/llm-instruction-eval-openai.ipynb +++ b/ch07/03_model-evaluation/llm-instruction-eval-openai.ipynb @@ -57,7 +57,7 @@ "metadata": {}, "outputs": [], "source": [ - "# pip install -r requirements-exra.txt" + "# pip install -r requirements-extra.txt" ] }, { @@ -110,31 +110,28 @@ "id": "89343a84-0ddc-42fc-bf50-298a342b93c0", "metadata": {}, "source": [ - "OPENAI_API_KEY = \"Your Open AI API Key\"- First, we need to provide our OpenAI API key, which can be found at https://platform.openai.com/api-keys\n", - "- Make sure not to share this key with anyone (make sure to delete it from this notebook in case you intend to share it; I recommend deleting the entire notebook cell that contains the key)\n", - "- Alternatively, delete the used API key from your account after you are finished to make sure it can't be abused later" + "- First, we need to provide our OpenAI API secret key, which can be found at https://platform.openai.com/api-keys\n", + "- Make sure not to share this key with anyone\n", + "- Add this secret key (`\"sk-...\"`) to the `config.json` file in this folder" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "65b0ba76-1fb1-4306-a7c2-8f3bb637ccdb", "metadata": {}, "outputs": [], "source": [ - "OPENAI_API_KEY = \"Your Open AI API Key\"" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "26900564-aba7-48ba-8ee8-6cc9a505a25c", - "metadata": {}, - "outputs": [], - "source": [ + "import json\n", "from openai import OpenAI\n", "\n", - "client = OpenAI(api_key=OPENAI_API_KEY)" + "# Load API key from a JSON file. \n", + "# Make sure to replace \"sk-...\" with your actual API key from https://platform.openai.com/api-keys\n", + "with open(\"config.json\", \"r\") as config_file:\n", + " config = json.load(config_file)\n", + " api_key = config[\"OPENAI_API_KEY\"]\n", + "\n", + "client = OpenAI(api_key=api_key)" ] }, { @@ -147,7 +144,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "id": "08e9ef2e-e816-4283-840e-43625791ad33", "metadata": {}, "outputs": [ @@ -157,7 +154,7 @@ "'hello world'" ] }, - "execution_count": 5, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -195,7 +192,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "id": "8b2d393a-aa92-4190-9d44-44326a6f699b", "metadata": {}, "outputs": [ @@ -228,7 +225,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "id": "7222fdc0-5684-4f2b-b741-3e341851359e", "metadata": {}, "outputs": [ @@ -242,7 +239,7 @@ " 'model 2 response': '\\nThe hypotenuse of the triangle is 12 cm.'}" ] }, - "execution_count": 7, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -261,7 +258,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "id": "43263cd3-e5fb-4ab5-871e-3ad6e7d21a8c", "metadata": {}, "outputs": [], @@ -289,7 +286,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "id": "735cc089-d127-480a-b39d-0782581f0c41", "metadata": {}, "outputs": [ @@ -308,11 +305,15 @@ "Score:\n", ">> The model response \"The hypotenuse of the triangle is 3 cm.\" is incorrect. The correct calculation of the hypotenuse for a right triangle with legs of 6 cm and 8 cm should be done using the Pythagorean theorem, which states that the square of the hypotenuse (c) is equal to the sum of the squares of the other two sides (a and b). Thus, \\( c = \\sqrt{6^2 + 8^2} = \\sqrt{36 + 64} = \\sqrt{100} = 10 \\) cm.\n", "\n", - "The model response provided a hypotenuse of 3 cm, which is not only incorrect but also mathematically impossible given the lengths of the legs (since 3 cm is less than either leg of the triangle, it cannot be the hypotenuse in a right triangle with these dimensions).\n", + "The model response provides a hypotenuse of 3 cm, which is not only numerically incorrect but also logically inconsistent because the hypotenuse is the longest side of a right triangle and cannot be shorter than either of the other two sides (6 cm and 8 cm in this case).\n", "\n", - "Given the incorrectness and the impossibility of the response, the score would be very low. However, since the response format is correct (stating the hypotenuse is a certain measurement in cm), it does not score absolutely zero.\n", + "Given the scale from 0 to 100, where 100 is the best score:\n", + "- Accuracy: The response is completely inaccurate.\n", + "- Relevance: The response addresses the task of calculating the hypotenuse but fails to do so correctly.\n", "\n", - "Score: 10/100. The points are given for maintaining the correct format and units in the response, but the mathematical error is significant and fundamental, leading to a low score.\n", + "Score: 0\n", + "\n", + "The score is 0 because the response is factually incorrect and provides misleading information that does not fulfill the task as required.\n", "\n", "-------------------------\n", "\n", @@ -331,28 +332,22 @@ "6. Cobra\n", "\n", "Score:\n", - ">> To evaluate the model response against the given instruction, we need to consider the accuracy, relevance, and adherence to the instruction's requirements. The instruction specifically asks for the names of three different animals that are active during the day.\n", + ">> The model response lists six animals, three of which are repeated, and includes animals not specifically known for being diurnal (active during the day). The instruction specifically asked for three different animals that are active during the day. Here's the breakdown:\n", "\n", - "### Analysis of Model Response:\n", - "1. **Relevance and Accuracy**: \n", - " - **Squirrel**: Correct, squirrels are diurnal (active during the day).\n", - " - **Tiger**: Correct, though tigers can be crepuscular (active during dawn and dusk), they are often active during the day as well.\n", - " - **Eagle**: Correct, eagles are generally diurnal.\n", - " - **Cobra**: Incorrect, cobras are generally not active during the day; they are more active during the early and late hours of the day, making them crepuscular.\n", - "\n", - "2. **Adherence to Instruction**:\n", - " - The instruction asked for three different animals. The model response listed six items, which is double the requested amount.\n", - " - The response includes repetitions (Tiger and Cobra are each mentioned twice), which does not align with the instruction to name different animals.\n", + "1. **Squirrel** - Correct, squirrels are diurnal.\n", + "2. **Tiger** - Generally, tigers are crepuscular (active during dawn and dusk) rather than strictly diurnal, but they can be active during the day, especially in cooler weather.\n", + "3. **Eagle** - Correct, eagles are diurnal.\n", + "4. **Cobra** - Incorrect, cobras are generally not diurnal; they are more active during the evening and early morning.\n", + "5. **Tiger** - Repeated, and as noted, not strictly diurnal.\n", + "6. **Cobra** - Repeated and incorrect.\n", "\n", "### Scoring:\n", - "- **Accuracy**: 3/4 entries are accurate in terms of being day-active animals.\n", - "- **Relevance**: The response includes more animals than requested and repeats some animals.\n", - "- **Adherence to Instruction**: The instruction was to list three different animals, but the response included six entries with repetitions.\n", - "\n", - "Given these points, the model response partially meets the accuracy requirement but fails significantly in adherence to the instruction's format and specificity. The inclusion of incorrect information (Cobra) and unnecessary repetitions also detracts from the quality of the response.\n", + "- **Relevance to the task**: The task was to name three different animals active during the day. The response included two correct diurnal animals (squirrel, eagle) but also included incorrect and repeated entries.\n", + "- **Accuracy**: Including animals not known for being diurnal (cobra) and repeating animals reduces the accuracy.\n", + "- **Adherence to instruction**: The instruction asked for three animals, but six were provided, with repetitions.\n", "\n", "### Score: 40/100\n", - "This score reflects that while some of the response was accurate, the failure to adhere to the specific number of animals requested, the inclusion of an incorrect animal, and the repetition of animals significantly lower the quality of the response according to the given instruction.\n", + "**Reasoning**: The response partially meets the criteria by including some correct animals but fails in terms of accuracy (inclusion of non-diurnal animals), repetition of animals, and not adhering to the instruction of listing only three animals.\n", "\n", "-------------------------\n", "\n", @@ -364,15 +359,11 @@ "What is incorrect?\n", "\n", "Score:\n", - ">> The model response \"What is incorrect?\" would score relatively low on the scale for the given task. Here's the breakdown:\n", + ">> The model response \"What is incorrect?\" would score relatively low on the scale for the given task. The original instruction was to rewrite the sentence \"I need to find out what's wrong\" in a more formal way. The correct output provided, \"I must ascertain what is incorrect,\" effectively increases the formality of the original sentence by using more formal vocabulary (\"must\" instead of \"need\" and \"ascertain\" instead of \"find out\") and adjusting the phrasing (\"what is incorrect\" instead of \"what's wrong\").\n", "\n", - "1. **Understanding of Instruction**: The instruction specifically asks for a more formal rewrite of the sentence \"I need to find out what's wrong.\" The model response does not fully capture the original sentence's intent of needing to discover or ascertain the issue. Instead, it poses a direct question about what is incorrect, which changes the nature of the statement from a declaration to an inquiry. This indicates a partial misunderstanding or incomplete execution of the task.\n", + "The model response, however, only addresses part of the sentence and does not maintain the original meaning or structure. It changes the sentence into a question and omits the aspect of needing to discover or investigate the issue, which is a critical component of the original sentence. Additionally, it does not enhance the formality significantly.\n", "\n", - "2. **Formality**: The response does use slightly more formal language by using \"incorrect\" instead of \"wrong.\" However, it lacks the formal structure expected in rewriting the original sentence. The original sentence's intent and structure as a statement of need (\"I need to find out...\") are not preserved.\n", - "\n", - "3. **Completeness**: The response does not include the aspect of needing to \"find out,\" which is crucial to the original sentence. It merely asks what is incorrect, without indicating the necessity or process of discovery.\n", - "\n", - "Given these points, the response would score around **30 out of 100**. It recognizes the need for more formal language but fails to accurately and completely transform the original sentence while maintaining its intent and structure.\n", + "Given these considerations, I would score the model response around 20 out of 100. It recognizes the need to adjust the formality slightly but fails to maintain the original sentence's intent and structure, and does not fully meet the requirement of rewriting the sentence in a more formal way.\n", "\n", "-------------------------\n", "\n", @@ -384,11 +375,7 @@ "The interjection in the sentence is 'Wow'.\n", "\n", "Score:\n", - ">> The model response `The interjection in the sentence is 'Wow'.` accurately identifies the interjection in the given sentence. The response is clear, directly addresses the instruction, and correctly identifies \"Wow\" as the interjection, which is used to express surprise or admiration, fitting the context of the sentence provided.\n", - "\n", - "Score: 100/100\n", - "\n", - "The response fully meets the requirements of the task and correctly answers the question without any errors or omissions.\n", + ">> The model response `The interjection in the sentence is 'Wow'.` accurately identifies the interjection in the provided sentence. The response is clear, directly addresses the instruction, and correctly identifies \"Wow\" as the interjection. Therefore, the response should be scored 100 out of 100.\n", "\n", "-------------------------\n", "\n", @@ -402,11 +389,11 @@ "Score:\n", ">> The model response \"The type of sentence is exclamatory.\" is incorrect. The correct type of the sentence \"Did you finish the report?\" is interrogative, as it is a question. An exclamatory sentence would express strong emotion and typically ends with an exclamation mark.\n", "\n", - "Given the incorrect identification of the sentence type, the score for the model response should be low. However, the response does correctly identify a type of sentence, just not the correct one for the given input. Therefore, it shows some understanding of sentence types but fails in accurate application.\n", + "Given the incorrect identification of the sentence type, the score for the model response should be low. However, the response does correctly format the answer by stating \"The type of sentence is...\" which shows an understanding of the task's requirements but fails in accuracy.\n", "\n", - "Score: 20/100\n", + "Score: 10/100\n", "\n", - "This score reflects that the response is on topic (discussing sentence types) but incorrect in its specific application to the provided sentence.\n", + "The score reflects that the response is well-structured but fundamentally incorrect in identifying the sentence type.\n", "\n", "-------------------------\n" ] @@ -438,29 +425,22 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "id": "3552bdfb-7511-42ac-a9ec-da672e2a5468", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[0, 50, 20, 100, 0]\n" - ] - } - ], + "outputs": [], "source": [ - "def generate_model_scores(json_data, json_key):\n", + "from tqdm import tqdm\n", "\n", + "def generate_model_scores(json_data, json_key, client):\n", " scores = []\n", - " for entry in json_data:\n", - " \n", - " prompt = (f\"Given the input `{format_input(entry)}` \"\n", - " f\"and correct output `{entry['output']}`, \"\n", - " f\"score the model response `{entry[json_key]}`\"\n", - " f\" on a scale from 0 to 100, where 100 is the best score. \"\n", - " f\"Respond with the number only.\"\n", + " for entry in tqdm(json_data, desc=\"Scoring entries\"):\n", + " prompt = (\n", + " f\"Given the input `{format_input(entry)}` \"\n", + " f\"and correct output `{entry['output']}`, \"\n", + " f\"score the model response `{entry[json_key]}`\"\n", + " f\" on a scale from 0 to 100, where 100 is the best score. \"\n", + " f\"Respond with the number only.\"\n", " )\n", " score = run_chatgpt(prompt, client)\n", " try:\n", @@ -468,9 +448,7 @@ " except:\n", " continue\n", "\n", - " return scores\n", - "\n", - "print(generate_model_scores(json_data[:5], \"model 1 response\"))" + " return scores" ] }, { @@ -491,10 +469,17 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "id": "4f700d4b-19e5-4404-afa7-b0f093024232", "metadata": {}, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Scoring entries: 100%|█████████████████████████████████████████████████| 100/100 [01:09<00:00, 1.44it/s]\n" + ] + }, { "name": "stdout", "output_type": "stream", @@ -502,21 +487,43 @@ "\n", "model 1 response\n", "Number of scores: 100 of 100\n", - "Average score: 73.54\n", + "Average score: 74.04\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Scoring entries: 100%|█████████████████████████████████████████████████| 100/100 [01:08<00:00, 1.46it/s]" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ "\n", "model 2 response\n", "Number of scores: 100 of 100\n", - "Average score: 56.52\n" + "Average score: 56.72\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\n" ] } ], "source": [ "for model in (\"model 1 response\", \"model 2 response\"):\n", "\n", - " scores = generate_model_scores(json_data, model)\n", + " scores = generate_model_scores(json_data, model, client)\n", " print(f\"\\n{model}\")\n", " print(f\"Number of scores: {len(scores)} of {len(json_data)}\")\n", - " print(f\"Average score: {sum(scores)/len(scores):.2f}\")" + " print(f\"Average score: {sum(scores)/len(scores):.2f}\\n\")" ] }, { From 9eeeb67329f6ee0ee562a716586722bf00d68bb8 Mon Sep 17 00:00:00 2001 From: rasbt Date: Mon, 27 May 2024 07:30:27 -0500 Subject: [PATCH 4/8] newline --- .../exercise-solutions.ipynb | 2 +- .../multihead-attention.ipynb | 2 +- .../mha-implementations.ipynb | 2 +- ch07/02_dataset-utilities/config.json | 2 +- .../instruction-examples-modified.json | 56 +++++++++---------- ch07/03_model-evaluation/config.json | 2 +- 6 files changed, 33 insertions(+), 33 deletions(-) diff --git a/ch03/01_main-chapter-code/exercise-solutions.ipynb b/ch03/01_main-chapter-code/exercise-solutions.ipynb index 3465a8f..49ae7f2 100644 --- a/ch03/01_main-chapter-code/exercise-solutions.ipynb +++ b/ch03/01_main-chapter-code/exercise-solutions.ipynb @@ -320,7 +320,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.10.6" } }, "nbformat": 4, diff --git a/ch03/01_main-chapter-code/multihead-attention.ipynb b/ch03/01_main-chapter-code/multihead-attention.ipynb index b788040..3cf719f 100644 --- a/ch03/01_main-chapter-code/multihead-attention.ipynb +++ b/ch03/01_main-chapter-code/multihead-attention.ipynb @@ -391,7 +391,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.10.6" } }, "nbformat": 4, diff --git a/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb b/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb index 82f5cde..cd29166 100644 --- a/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb +++ b/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb @@ -1038,7 +1038,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.10.6" } }, "nbformat": 4, diff --git a/ch07/02_dataset-utilities/config.json b/ch07/02_dataset-utilities/config.json index c0bdf62..a01cb47 100644 --- a/ch07/02_dataset-utilities/config.json +++ b/ch07/02_dataset-utilities/config.json @@ -1,4 +1,4 @@ { "OPENAI_API_KEY": "sk-...", "_comment": "Enter your API key from https://platform.openai.com/api-keys" -} \ No newline at end of file +} diff --git a/ch07/02_dataset-utilities/instruction-examples-modified.json b/ch07/02_dataset-utilities/instruction-examples-modified.json index 333b83b..44f5418 100644 --- a/ch07/02_dataset-utilities/instruction-examples-modified.json +++ b/ch07/02_dataset-utilities/instruction-examples-modified.json @@ -3,7 +3,7 @@ "instruction": "Identify the verb in the following sentence: The cat sleeps on the couch.", "input": "", "output": "The verb in the sentence is \"sleeps.\"", - "output_2": "The sentence is \"The verb in the sentence is slept.\"" + "output_2": "The sentence is \"sleeps.\"" }, { "instruction": "What is the plural form of \"goose\"?", @@ -63,7 +63,7 @@ "instruction": "Generate three adjectives to describe a mountain.", "input": "", "output": "1. Majestic\n2. Rugged\n3. Towering", - "output_2": "1. Majestic\n2. Rugged\n3. Towering\n\n(Note: The words provided are adjectives and not sentences, hence they cannot be converted into passive voice as they do not contain a verb.)" + "output_2": "1. Majestic\n2. Rugged\n3. Towering\n\n(Note: The words provided are adjectives and do not have active or passive voice forms. Adjectives describe nouns and do not imply any action that can be converted between active and passive voice.)" }, { "instruction": "Determine the state of matter for helium at room temperature.", @@ -81,7 +81,7 @@ "instruction": "What is the symbol for the chemical element iron?", "input": "", "output": "The symbol for the chemical element iron is Fe.", - "output_2": "The symbol for the chemical element iron is represented by Fe." + "output_2": "The symbol Fe is used for the chemical element iron." }, { "instruction": "Convert the sentence into a question by adding a question tag.", @@ -105,13 +105,13 @@ "instruction": "Provide a word that rhymes with \"care.\"", "input": "", "output": "A word that rhymes with \"care\" is \"fare.\"", - "output_2": "A word with which \"care\" rhymes is \"fare.\"" + "output_2": "A word that \"fare\" rhymes with is \"care.\"" }, { "instruction": "Rewrite this sentence to start with \"Despite\": She managed to finish her work, although she was tired.", "input": "", "output": "Despite being tired, she managed to finish her work.", - "output_2": "Despite being tired, the work was managed to be finished by her." + "output_2": "Despite being tired, her work was managed to be finished by her." }, { "instruction": "Convert the following sentence to use a relative clause: The man is a teacher. He lives next door.", @@ -147,7 +147,7 @@ "instruction": "Explain what a haiku is.", "input": "", "output": "A haiku is a form of traditional Japanese poetry that consists of three lines with a syllable pattern of 5-7-5.", - "output_2": "A form of traditional Japanese poetry known as a haiku consists of three lines with a syllable pattern of 5-7-5." + "output_2": "A form of traditional Japanese poetry that consists of three lines with a syllable pattern of 5-7-5 is known as a haiku." }, { "instruction": "Provide the past tense form of the verb \"run.\"", @@ -177,7 +177,7 @@ "instruction": "Name an antonym for \"joy.\"", "input": "", "output": "An antonym for \"joy\" is \"sorrow.\"", - "output_2": "An antonym for \"joy\" is considered to be \"sorrow.\"" + "output_2": "An antonym for \"joy\" is identified as \"sorrow.\"" }, { "instruction": "Classify the following items: apple, diamond, fern.", @@ -189,13 +189,13 @@ "instruction": "Generate three adjectives to describe the ocean.", "input": "", "output": "1. Vast\n2. Mysterious\n3. Serene", - "output_2": "1. Vast is remained.\n2. Mysterious is considered.\n3. Serene is felt." + "output_2": "1. Vastness is experienced.\n2. Mysteriousness is perceived.\n3. Serenity is felt." }, { "instruction": "Determine the state of matter for nitrogen at room temperature.", "input": "", "output": "Nitrogen is in a gaseous state at room temperature.", - "output_2": "At room temperature, nitrogen is in a gaseous state." + "output_2": "At room temperature, nitrogen is found in a gaseous state." }, { "instruction": "Convert the following statement into a question.", @@ -249,7 +249,7 @@ "instruction": "Rewrite the following sentence using passive voice.", "input": "The team achieved great results.", "output": "Great results were achieved by the team.", - "output_2": "The team achieved great results." + "output_2": "Great results were achieved by the team." }, { "instruction": "Edit the following sentence to make it more formal.", @@ -261,7 +261,7 @@ "instruction": "Arrange the given numbers in descending order.", "input": "7, 10, 3, 6, 9", "output": "10, 9, 7, 6, 3.", - "output_2": "10, 9, 7, 6, 3 were counted." + "output_2": "10, 9, 7, 6, 3 were converted to passive voice." }, { "instruction": "Given a sentence, convert it into indirect speech.", @@ -297,7 +297,7 @@ "instruction": "Change this sentence into the past continuous tense.", "input": "She sings in the choir.", "output": "She was singing in the choir.", - "output_2": "Singing in the choir was being done by her." + "output_2": "The choir was being sung in by her." }, { "instruction": "Make the first sentence a dependent clause.", @@ -327,7 +327,7 @@ "instruction": "Correct the grammatical errors in this sentence.", "input": "He don't know nothing about it.", "output": "He doesn't know anything about it.", - "output_2": "Anything about it is not known by him." + "output_2": "Nothing about it is known by him." }, { "instruction": "Rewrite the following sentence to remove redundancy.", @@ -381,13 +381,13 @@ "instruction": "Find a rhyming word for the word \"care.\"", "input": "", "output": "A rhyming word for the word \"care\" could be \"bare.\"", - "output_2": "A rhyming word for the word \"care\" could be \"bare\" by \"bare.\"" + "output_2": "A rhyming word for the word \"care\" could be \"bare\" is said." }, { "instruction": "Reword the following sentence to the future tense.", "input": "He is reading a novel inspired by his grandmother.", "output": "He will be reading a novel inspired by his grandmother.", - "output_2": "A novel inspired by his grandmother will be being read by him." + "output_2": "A novel inspired by his grandmother will be read by him." }, { "instruction": "Classify the following fruit according to its type.", @@ -561,7 +561,7 @@ "instruction": "Categorize the following sentence as either factual or opinion-based.", "input": "Chocolate is the best dessert.", "output": "Opinion-based.", - "output_2": "Opinion-based was written." + "output_2": "Based on opinion." }, { "instruction": "Classify each sentence as either declarative, interrogative, imperative, or exclamatory.", @@ -663,7 +663,7 @@ "instruction": "Label whether the following statements are true or false.", "input": "The moon is a planet.", "output": "False", - "output_2": "False is not a sentence and therefore cannot be converted into passive voice." + "output_2": "False is not a sentence and cannot be converted into passive voice." }, { "instruction": "Combine the given sentences into one cohesive sentence.", @@ -675,13 +675,13 @@ "instruction": "Rewrite the given passage in the past tense.", "input": "They are building a new library.", "output": "They built a new library.", - "output_2": "A new library was built." + "output_2": "A new library was built by them." }, { "instruction": "Change the following sentence so that it is in the past tense.", "input": "He runs to the store.", "output": "He ran to the store.", - "output_2": "The store was run to by him." + "output_2": "To the store he was run." }, { "instruction": "Edit the following sentence to remove all passive voice.", @@ -717,7 +717,7 @@ "instruction": "Classify the following online review as being positive or negative.", "input": "I found this book to be incredibly insightful and informative.", "output": "The online review is positive.", - "output_2": "The online review is considered positive." + "output_2": "A positive review is given online." }, { "instruction": "Reverse the following list alphabetically.", @@ -831,7 +831,7 @@ "instruction": "Find a synonym for the word 'start'.", "input": "", "output": "A synonym for the word 'start' could be \"commence.\"", - "output_2": "A synonym for the word 'start' could be \"commence\" by some." + "output_2": "A synonym for the word 'start' could be \"commence\" by someone." }, { "instruction": "Change the sentence \"This should not have happened\" into a declarative sentence.", @@ -867,7 +867,7 @@ "instruction": "Scramble the given phrase.", "input": "A random phrase", "output": "A nmaodr hrasep", - "output_2": "A nmaodr hrasep was written." + "output_2": "A nmaodr hrasep was converted." }, { "instruction": "rewrite this sentence as a question.", @@ -951,13 +951,13 @@ "instruction": "Rewrite the sentence to use a negative adverb.", "input": "She always remembers to call.", "output": "She never forgets to call.", - "output_2": "It is never forgotten by her to call." + "output_2": "To call is never forgotten by her." }, { "instruction": "Categorize the given list of animals.", "input": "Shark, Dolphin, Trout", "output": "Fish: Shark, Trout\nMammals: Dolphin", - "output_2": "Fish: Shark, Trout are listed.\nMammals: Dolphin is listed." + "output_2": "Fish: Shark, Trout\nMammals: Dolphin" }, { "instruction": "Rewrite the sentence using a synonym.", @@ -987,7 +987,7 @@ "instruction": "Evaluate the following phrase by transforming it into the spelling given.", "input": "freind --> friend", "output": "The spelling of the given phrase \"freind\" is incorrect, the correct spelling is \"friend\".", - "output_2": "The spelling of the given phrase \"freind\" is identified as incorrect; the correct spelling is identified as \"friend\"." + "output_2": "The spelling of the given phrase \"freind\" is said to be incorrect; \"friend\" is stated as the correct spelling." }, { "instruction": "Select the noun phrase in the following sentence.", @@ -1053,7 +1053,7 @@ "instruction": "Convert 10 feet to meters.", "input": "", "output": "10 feet is equal to approximately 3.048 meters.", - "output_2": "Approximately 3.048 meters is equal to 10 feet." + "output_2": "Approximately 3.048 meters is equaled by 10 feet." }, { "instruction": "Simplify the given sentence.", @@ -1083,7 +1083,7 @@ "instruction": "Find the synonym for the given verb.", "input": "Begin", "output": "Commence", - "output_2": "The following text is to be converted to passive voice: Commence." + "output_2": "Be commenced." }, { "instruction": "Name 3 different animals that are active during the day.", @@ -1119,7 +1119,7 @@ "instruction": "Classify the following animal as carnivore, herbivore, or omnivore.", "input": "Deer", "output": "Herbivore", - "output_2": "I'm sorry, but the word \"Herbivore\" does not form a sentence and thus cannot be converted into passive voice. Passive voice requires a sentence with a clear subject, verb, and object, which is not applicable to a single noun." + "output_2": "I'm sorry, but the word \"Herbivore\" does not form a sentence and thus cannot be converted into passive voice. Passive voice requires a sentence with a clear subject, verb, and object, which is not present in a single noun." }, { "instruction": "Fix the following grammar mistake.", diff --git a/ch07/03_model-evaluation/config.json b/ch07/03_model-evaluation/config.json index c0bdf62..a01cb47 100644 --- a/ch07/03_model-evaluation/config.json +++ b/ch07/03_model-evaluation/config.json @@ -1,4 +1,4 @@ { "OPENAI_API_KEY": "sk-...", "_comment": "Enter your API key from https://platform.openai.com/api-keys" -} \ No newline at end of file +} From 6aa2a587d22105910bd6f07c6c79a5abf83a5eb6 Mon Sep 17 00:00:00 2001 From: rasbt Date: Mon, 27 May 2024 07:32:22 -0500 Subject: [PATCH 5/8] Revert "newline" This reverts commit 9eeeb67329f6ee0ee562a716586722bf00d68bb8. --- .../exercise-solutions.ipynb | 2 +- .../multihead-attention.ipynb | 2 +- .../mha-implementations.ipynb | 2 +- ch07/02_dataset-utilities/config.json | 2 +- .../instruction-examples-modified.json | 56 +++++++++---------- ch07/03_model-evaluation/config.json | 2 +- 6 files changed, 33 insertions(+), 33 deletions(-) diff --git a/ch03/01_main-chapter-code/exercise-solutions.ipynb b/ch03/01_main-chapter-code/exercise-solutions.ipynb index 49ae7f2..3465a8f 100644 --- a/ch03/01_main-chapter-code/exercise-solutions.ipynb +++ b/ch03/01_main-chapter-code/exercise-solutions.ipynb @@ -320,7 +320,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.11.4" } }, "nbformat": 4, diff --git a/ch03/01_main-chapter-code/multihead-attention.ipynb b/ch03/01_main-chapter-code/multihead-attention.ipynb index 3cf719f..b788040 100644 --- a/ch03/01_main-chapter-code/multihead-attention.ipynb +++ b/ch03/01_main-chapter-code/multihead-attention.ipynb @@ -391,7 +391,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.11.4" } }, "nbformat": 4, diff --git a/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb b/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb index cd29166..82f5cde 100644 --- a/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb +++ b/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb @@ -1038,7 +1038,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.11.4" } }, "nbformat": 4, diff --git a/ch07/02_dataset-utilities/config.json b/ch07/02_dataset-utilities/config.json index a01cb47..c0bdf62 100644 --- a/ch07/02_dataset-utilities/config.json +++ b/ch07/02_dataset-utilities/config.json @@ -1,4 +1,4 @@ { "OPENAI_API_KEY": "sk-...", "_comment": "Enter your API key from https://platform.openai.com/api-keys" -} +} \ No newline at end of file diff --git a/ch07/02_dataset-utilities/instruction-examples-modified.json b/ch07/02_dataset-utilities/instruction-examples-modified.json index 44f5418..333b83b 100644 --- a/ch07/02_dataset-utilities/instruction-examples-modified.json +++ b/ch07/02_dataset-utilities/instruction-examples-modified.json @@ -3,7 +3,7 @@ "instruction": "Identify the verb in the following sentence: The cat sleeps on the couch.", "input": "", "output": "The verb in the sentence is \"sleeps.\"", - "output_2": "The sentence is \"sleeps.\"" + "output_2": "The sentence is \"The verb in the sentence is slept.\"" }, { "instruction": "What is the plural form of \"goose\"?", @@ -63,7 +63,7 @@ "instruction": "Generate three adjectives to describe a mountain.", "input": "", "output": "1. Majestic\n2. Rugged\n3. Towering", - "output_2": "1. Majestic\n2. Rugged\n3. Towering\n\n(Note: The words provided are adjectives and do not have active or passive voice forms. Adjectives describe nouns and do not imply any action that can be converted between active and passive voice.)" + "output_2": "1. Majestic\n2. Rugged\n3. Towering\n\n(Note: The words provided are adjectives and not sentences, hence they cannot be converted into passive voice as they do not contain a verb.)" }, { "instruction": "Determine the state of matter for helium at room temperature.", @@ -81,7 +81,7 @@ "instruction": "What is the symbol for the chemical element iron?", "input": "", "output": "The symbol for the chemical element iron is Fe.", - "output_2": "The symbol Fe is used for the chemical element iron." + "output_2": "The symbol for the chemical element iron is represented by Fe." }, { "instruction": "Convert the sentence into a question by adding a question tag.", @@ -105,13 +105,13 @@ "instruction": "Provide a word that rhymes with \"care.\"", "input": "", "output": "A word that rhymes with \"care\" is \"fare.\"", - "output_2": "A word that \"fare\" rhymes with is \"care.\"" + "output_2": "A word with which \"care\" rhymes is \"fare.\"" }, { "instruction": "Rewrite this sentence to start with \"Despite\": She managed to finish her work, although she was tired.", "input": "", "output": "Despite being tired, she managed to finish her work.", - "output_2": "Despite being tired, her work was managed to be finished by her." + "output_2": "Despite being tired, the work was managed to be finished by her." }, { "instruction": "Convert the following sentence to use a relative clause: The man is a teacher. He lives next door.", @@ -147,7 +147,7 @@ "instruction": "Explain what a haiku is.", "input": "", "output": "A haiku is a form of traditional Japanese poetry that consists of three lines with a syllable pattern of 5-7-5.", - "output_2": "A form of traditional Japanese poetry that consists of three lines with a syllable pattern of 5-7-5 is known as a haiku." + "output_2": "A form of traditional Japanese poetry known as a haiku consists of three lines with a syllable pattern of 5-7-5." }, { "instruction": "Provide the past tense form of the verb \"run.\"", @@ -177,7 +177,7 @@ "instruction": "Name an antonym for \"joy.\"", "input": "", "output": "An antonym for \"joy\" is \"sorrow.\"", - "output_2": "An antonym for \"joy\" is identified as \"sorrow.\"" + "output_2": "An antonym for \"joy\" is considered to be \"sorrow.\"" }, { "instruction": "Classify the following items: apple, diamond, fern.", @@ -189,13 +189,13 @@ "instruction": "Generate three adjectives to describe the ocean.", "input": "", "output": "1. Vast\n2. Mysterious\n3. Serene", - "output_2": "1. Vastness is experienced.\n2. Mysteriousness is perceived.\n3. Serenity is felt." + "output_2": "1. Vast is remained.\n2. Mysterious is considered.\n3. Serene is felt." }, { "instruction": "Determine the state of matter for nitrogen at room temperature.", "input": "", "output": "Nitrogen is in a gaseous state at room temperature.", - "output_2": "At room temperature, nitrogen is found in a gaseous state." + "output_2": "At room temperature, nitrogen is in a gaseous state." }, { "instruction": "Convert the following statement into a question.", @@ -249,7 +249,7 @@ "instruction": "Rewrite the following sentence using passive voice.", "input": "The team achieved great results.", "output": "Great results were achieved by the team.", - "output_2": "Great results were achieved by the team." + "output_2": "The team achieved great results." }, { "instruction": "Edit the following sentence to make it more formal.", @@ -261,7 +261,7 @@ "instruction": "Arrange the given numbers in descending order.", "input": "7, 10, 3, 6, 9", "output": "10, 9, 7, 6, 3.", - "output_2": "10, 9, 7, 6, 3 were converted to passive voice." + "output_2": "10, 9, 7, 6, 3 were counted." }, { "instruction": "Given a sentence, convert it into indirect speech.", @@ -297,7 +297,7 @@ "instruction": "Change this sentence into the past continuous tense.", "input": "She sings in the choir.", "output": "She was singing in the choir.", - "output_2": "The choir was being sung in by her." + "output_2": "Singing in the choir was being done by her." }, { "instruction": "Make the first sentence a dependent clause.", @@ -327,7 +327,7 @@ "instruction": "Correct the grammatical errors in this sentence.", "input": "He don't know nothing about it.", "output": "He doesn't know anything about it.", - "output_2": "Nothing about it is known by him." + "output_2": "Anything about it is not known by him." }, { "instruction": "Rewrite the following sentence to remove redundancy.", @@ -381,13 +381,13 @@ "instruction": "Find a rhyming word for the word \"care.\"", "input": "", "output": "A rhyming word for the word \"care\" could be \"bare.\"", - "output_2": "A rhyming word for the word \"care\" could be \"bare\" is said." + "output_2": "A rhyming word for the word \"care\" could be \"bare\" by \"bare.\"" }, { "instruction": "Reword the following sentence to the future tense.", "input": "He is reading a novel inspired by his grandmother.", "output": "He will be reading a novel inspired by his grandmother.", - "output_2": "A novel inspired by his grandmother will be read by him." + "output_2": "A novel inspired by his grandmother will be being read by him." }, { "instruction": "Classify the following fruit according to its type.", @@ -561,7 +561,7 @@ "instruction": "Categorize the following sentence as either factual or opinion-based.", "input": "Chocolate is the best dessert.", "output": "Opinion-based.", - "output_2": "Based on opinion." + "output_2": "Opinion-based was written." }, { "instruction": "Classify each sentence as either declarative, interrogative, imperative, or exclamatory.", @@ -663,7 +663,7 @@ "instruction": "Label whether the following statements are true or false.", "input": "The moon is a planet.", "output": "False", - "output_2": "False is not a sentence and cannot be converted into passive voice." + "output_2": "False is not a sentence and therefore cannot be converted into passive voice." }, { "instruction": "Combine the given sentences into one cohesive sentence.", @@ -675,13 +675,13 @@ "instruction": "Rewrite the given passage in the past tense.", "input": "They are building a new library.", "output": "They built a new library.", - "output_2": "A new library was built by them." + "output_2": "A new library was built." }, { "instruction": "Change the following sentence so that it is in the past tense.", "input": "He runs to the store.", "output": "He ran to the store.", - "output_2": "To the store he was run." + "output_2": "The store was run to by him." }, { "instruction": "Edit the following sentence to remove all passive voice.", @@ -717,7 +717,7 @@ "instruction": "Classify the following online review as being positive or negative.", "input": "I found this book to be incredibly insightful and informative.", "output": "The online review is positive.", - "output_2": "A positive review is given online." + "output_2": "The online review is considered positive." }, { "instruction": "Reverse the following list alphabetically.", @@ -831,7 +831,7 @@ "instruction": "Find a synonym for the word 'start'.", "input": "", "output": "A synonym for the word 'start' could be \"commence.\"", - "output_2": "A synonym for the word 'start' could be \"commence\" by someone." + "output_2": "A synonym for the word 'start' could be \"commence\" by some." }, { "instruction": "Change the sentence \"This should not have happened\" into a declarative sentence.", @@ -867,7 +867,7 @@ "instruction": "Scramble the given phrase.", "input": "A random phrase", "output": "A nmaodr hrasep", - "output_2": "A nmaodr hrasep was converted." + "output_2": "A nmaodr hrasep was written." }, { "instruction": "rewrite this sentence as a question.", @@ -951,13 +951,13 @@ "instruction": "Rewrite the sentence to use a negative adverb.", "input": "She always remembers to call.", "output": "She never forgets to call.", - "output_2": "To call is never forgotten by her." + "output_2": "It is never forgotten by her to call." }, { "instruction": "Categorize the given list of animals.", "input": "Shark, Dolphin, Trout", "output": "Fish: Shark, Trout\nMammals: Dolphin", - "output_2": "Fish: Shark, Trout\nMammals: Dolphin" + "output_2": "Fish: Shark, Trout are listed.\nMammals: Dolphin is listed." }, { "instruction": "Rewrite the sentence using a synonym.", @@ -987,7 +987,7 @@ "instruction": "Evaluate the following phrase by transforming it into the spelling given.", "input": "freind --> friend", "output": "The spelling of the given phrase \"freind\" is incorrect, the correct spelling is \"friend\".", - "output_2": "The spelling of the given phrase \"freind\" is said to be incorrect; \"friend\" is stated as the correct spelling." + "output_2": "The spelling of the given phrase \"freind\" is identified as incorrect; the correct spelling is identified as \"friend\"." }, { "instruction": "Select the noun phrase in the following sentence.", @@ -1053,7 +1053,7 @@ "instruction": "Convert 10 feet to meters.", "input": "", "output": "10 feet is equal to approximately 3.048 meters.", - "output_2": "Approximately 3.048 meters is equaled by 10 feet." + "output_2": "Approximately 3.048 meters is equal to 10 feet." }, { "instruction": "Simplify the given sentence.", @@ -1083,7 +1083,7 @@ "instruction": "Find the synonym for the given verb.", "input": "Begin", "output": "Commence", - "output_2": "Be commenced." + "output_2": "The following text is to be converted to passive voice: Commence." }, { "instruction": "Name 3 different animals that are active during the day.", @@ -1119,7 +1119,7 @@ "instruction": "Classify the following animal as carnivore, herbivore, or omnivore.", "input": "Deer", "output": "Herbivore", - "output_2": "I'm sorry, but the word \"Herbivore\" does not form a sentence and thus cannot be converted into passive voice. Passive voice requires a sentence with a clear subject, verb, and object, which is not present in a single noun." + "output_2": "I'm sorry, but the word \"Herbivore\" does not form a sentence and thus cannot be converted into passive voice. Passive voice requires a sentence with a clear subject, verb, and object, which is not applicable to a single noun." }, { "instruction": "Fix the following grammar mistake.", diff --git a/ch07/03_model-evaluation/config.json b/ch07/03_model-evaluation/config.json index a01cb47..c0bdf62 100644 --- a/ch07/03_model-evaluation/config.json +++ b/ch07/03_model-evaluation/config.json @@ -1,4 +1,4 @@ { "OPENAI_API_KEY": "sk-...", "_comment": "Enter your API key from https://platform.openai.com/api-keys" -} +} \ No newline at end of file From 134334ce21e365dd540b5439aabe5aebfb8f546d Mon Sep 17 00:00:00 2001 From: rasbt Date: Mon, 27 May 2024 07:32:45 -0500 Subject: [PATCH 6/8] Revert "Revert "newline"" This reverts commit 6aa2a587d22105910bd6f07c6c79a5abf83a5eb6. --- .../exercise-solutions.ipynb | 2 +- .../multihead-attention.ipynb | 2 +- .../mha-implementations.ipynb | 2 +- ch07/02_dataset-utilities/config.json | 2 +- .../instruction-examples-modified.json | 56 +++++++++---------- ch07/03_model-evaluation/config.json | 2 +- 6 files changed, 33 insertions(+), 33 deletions(-) diff --git a/ch03/01_main-chapter-code/exercise-solutions.ipynb b/ch03/01_main-chapter-code/exercise-solutions.ipynb index 3465a8f..49ae7f2 100644 --- a/ch03/01_main-chapter-code/exercise-solutions.ipynb +++ b/ch03/01_main-chapter-code/exercise-solutions.ipynb @@ -320,7 +320,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.10.6" } }, "nbformat": 4, diff --git a/ch03/01_main-chapter-code/multihead-attention.ipynb b/ch03/01_main-chapter-code/multihead-attention.ipynb index b788040..3cf719f 100644 --- a/ch03/01_main-chapter-code/multihead-attention.ipynb +++ b/ch03/01_main-chapter-code/multihead-attention.ipynb @@ -391,7 +391,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.10.6" } }, "nbformat": 4, diff --git a/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb b/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb index 82f5cde..cd29166 100644 --- a/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb +++ b/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb @@ -1038,7 +1038,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.10.6" } }, "nbformat": 4, diff --git a/ch07/02_dataset-utilities/config.json b/ch07/02_dataset-utilities/config.json index c0bdf62..a01cb47 100644 --- a/ch07/02_dataset-utilities/config.json +++ b/ch07/02_dataset-utilities/config.json @@ -1,4 +1,4 @@ { "OPENAI_API_KEY": "sk-...", "_comment": "Enter your API key from https://platform.openai.com/api-keys" -} \ No newline at end of file +} diff --git a/ch07/02_dataset-utilities/instruction-examples-modified.json b/ch07/02_dataset-utilities/instruction-examples-modified.json index 333b83b..44f5418 100644 --- a/ch07/02_dataset-utilities/instruction-examples-modified.json +++ b/ch07/02_dataset-utilities/instruction-examples-modified.json @@ -3,7 +3,7 @@ "instruction": "Identify the verb in the following sentence: The cat sleeps on the couch.", "input": "", "output": "The verb in the sentence is \"sleeps.\"", - "output_2": "The sentence is \"The verb in the sentence is slept.\"" + "output_2": "The sentence is \"sleeps.\"" }, { "instruction": "What is the plural form of \"goose\"?", @@ -63,7 +63,7 @@ "instruction": "Generate three adjectives to describe a mountain.", "input": "", "output": "1. Majestic\n2. Rugged\n3. Towering", - "output_2": "1. Majestic\n2. Rugged\n3. Towering\n\n(Note: The words provided are adjectives and not sentences, hence they cannot be converted into passive voice as they do not contain a verb.)" + "output_2": "1. Majestic\n2. Rugged\n3. Towering\n\n(Note: The words provided are adjectives and do not have active or passive voice forms. Adjectives describe nouns and do not imply any action that can be converted between active and passive voice.)" }, { "instruction": "Determine the state of matter for helium at room temperature.", @@ -81,7 +81,7 @@ "instruction": "What is the symbol for the chemical element iron?", "input": "", "output": "The symbol for the chemical element iron is Fe.", - "output_2": "The symbol for the chemical element iron is represented by Fe." + "output_2": "The symbol Fe is used for the chemical element iron." }, { "instruction": "Convert the sentence into a question by adding a question tag.", @@ -105,13 +105,13 @@ "instruction": "Provide a word that rhymes with \"care.\"", "input": "", "output": "A word that rhymes with \"care\" is \"fare.\"", - "output_2": "A word with which \"care\" rhymes is \"fare.\"" + "output_2": "A word that \"fare\" rhymes with is \"care.\"" }, { "instruction": "Rewrite this sentence to start with \"Despite\": She managed to finish her work, although she was tired.", "input": "", "output": "Despite being tired, she managed to finish her work.", - "output_2": "Despite being tired, the work was managed to be finished by her." + "output_2": "Despite being tired, her work was managed to be finished by her." }, { "instruction": "Convert the following sentence to use a relative clause: The man is a teacher. He lives next door.", @@ -147,7 +147,7 @@ "instruction": "Explain what a haiku is.", "input": "", "output": "A haiku is a form of traditional Japanese poetry that consists of three lines with a syllable pattern of 5-7-5.", - "output_2": "A form of traditional Japanese poetry known as a haiku consists of three lines with a syllable pattern of 5-7-5." + "output_2": "A form of traditional Japanese poetry that consists of three lines with a syllable pattern of 5-7-5 is known as a haiku." }, { "instruction": "Provide the past tense form of the verb \"run.\"", @@ -177,7 +177,7 @@ "instruction": "Name an antonym for \"joy.\"", "input": "", "output": "An antonym for \"joy\" is \"sorrow.\"", - "output_2": "An antonym for \"joy\" is considered to be \"sorrow.\"" + "output_2": "An antonym for \"joy\" is identified as \"sorrow.\"" }, { "instruction": "Classify the following items: apple, diamond, fern.", @@ -189,13 +189,13 @@ "instruction": "Generate three adjectives to describe the ocean.", "input": "", "output": "1. Vast\n2. Mysterious\n3. Serene", - "output_2": "1. Vast is remained.\n2. Mysterious is considered.\n3. Serene is felt." + "output_2": "1. Vastness is experienced.\n2. Mysteriousness is perceived.\n3. Serenity is felt." }, { "instruction": "Determine the state of matter for nitrogen at room temperature.", "input": "", "output": "Nitrogen is in a gaseous state at room temperature.", - "output_2": "At room temperature, nitrogen is in a gaseous state." + "output_2": "At room temperature, nitrogen is found in a gaseous state." }, { "instruction": "Convert the following statement into a question.", @@ -249,7 +249,7 @@ "instruction": "Rewrite the following sentence using passive voice.", "input": "The team achieved great results.", "output": "Great results were achieved by the team.", - "output_2": "The team achieved great results." + "output_2": "Great results were achieved by the team." }, { "instruction": "Edit the following sentence to make it more formal.", @@ -261,7 +261,7 @@ "instruction": "Arrange the given numbers in descending order.", "input": "7, 10, 3, 6, 9", "output": "10, 9, 7, 6, 3.", - "output_2": "10, 9, 7, 6, 3 were counted." + "output_2": "10, 9, 7, 6, 3 were converted to passive voice." }, { "instruction": "Given a sentence, convert it into indirect speech.", @@ -297,7 +297,7 @@ "instruction": "Change this sentence into the past continuous tense.", "input": "She sings in the choir.", "output": "She was singing in the choir.", - "output_2": "Singing in the choir was being done by her." + "output_2": "The choir was being sung in by her." }, { "instruction": "Make the first sentence a dependent clause.", @@ -327,7 +327,7 @@ "instruction": "Correct the grammatical errors in this sentence.", "input": "He don't know nothing about it.", "output": "He doesn't know anything about it.", - "output_2": "Anything about it is not known by him." + "output_2": "Nothing about it is known by him." }, { "instruction": "Rewrite the following sentence to remove redundancy.", @@ -381,13 +381,13 @@ "instruction": "Find a rhyming word for the word \"care.\"", "input": "", "output": "A rhyming word for the word \"care\" could be \"bare.\"", - "output_2": "A rhyming word for the word \"care\" could be \"bare\" by \"bare.\"" + "output_2": "A rhyming word for the word \"care\" could be \"bare\" is said." }, { "instruction": "Reword the following sentence to the future tense.", "input": "He is reading a novel inspired by his grandmother.", "output": "He will be reading a novel inspired by his grandmother.", - "output_2": "A novel inspired by his grandmother will be being read by him." + "output_2": "A novel inspired by his grandmother will be read by him." }, { "instruction": "Classify the following fruit according to its type.", @@ -561,7 +561,7 @@ "instruction": "Categorize the following sentence as either factual or opinion-based.", "input": "Chocolate is the best dessert.", "output": "Opinion-based.", - "output_2": "Opinion-based was written." + "output_2": "Based on opinion." }, { "instruction": "Classify each sentence as either declarative, interrogative, imperative, or exclamatory.", @@ -663,7 +663,7 @@ "instruction": "Label whether the following statements are true or false.", "input": "The moon is a planet.", "output": "False", - "output_2": "False is not a sentence and therefore cannot be converted into passive voice." + "output_2": "False is not a sentence and cannot be converted into passive voice." }, { "instruction": "Combine the given sentences into one cohesive sentence.", @@ -675,13 +675,13 @@ "instruction": "Rewrite the given passage in the past tense.", "input": "They are building a new library.", "output": "They built a new library.", - "output_2": "A new library was built." + "output_2": "A new library was built by them." }, { "instruction": "Change the following sentence so that it is in the past tense.", "input": "He runs to the store.", "output": "He ran to the store.", - "output_2": "The store was run to by him." + "output_2": "To the store he was run." }, { "instruction": "Edit the following sentence to remove all passive voice.", @@ -717,7 +717,7 @@ "instruction": "Classify the following online review as being positive or negative.", "input": "I found this book to be incredibly insightful and informative.", "output": "The online review is positive.", - "output_2": "The online review is considered positive." + "output_2": "A positive review is given online." }, { "instruction": "Reverse the following list alphabetically.", @@ -831,7 +831,7 @@ "instruction": "Find a synonym for the word 'start'.", "input": "", "output": "A synonym for the word 'start' could be \"commence.\"", - "output_2": "A synonym for the word 'start' could be \"commence\" by some." + "output_2": "A synonym for the word 'start' could be \"commence\" by someone." }, { "instruction": "Change the sentence \"This should not have happened\" into a declarative sentence.", @@ -867,7 +867,7 @@ "instruction": "Scramble the given phrase.", "input": "A random phrase", "output": "A nmaodr hrasep", - "output_2": "A nmaodr hrasep was written." + "output_2": "A nmaodr hrasep was converted." }, { "instruction": "rewrite this sentence as a question.", @@ -951,13 +951,13 @@ "instruction": "Rewrite the sentence to use a negative adverb.", "input": "She always remembers to call.", "output": "She never forgets to call.", - "output_2": "It is never forgotten by her to call." + "output_2": "To call is never forgotten by her." }, { "instruction": "Categorize the given list of animals.", "input": "Shark, Dolphin, Trout", "output": "Fish: Shark, Trout\nMammals: Dolphin", - "output_2": "Fish: Shark, Trout are listed.\nMammals: Dolphin is listed." + "output_2": "Fish: Shark, Trout\nMammals: Dolphin" }, { "instruction": "Rewrite the sentence using a synonym.", @@ -987,7 +987,7 @@ "instruction": "Evaluate the following phrase by transforming it into the spelling given.", "input": "freind --> friend", "output": "The spelling of the given phrase \"freind\" is incorrect, the correct spelling is \"friend\".", - "output_2": "The spelling of the given phrase \"freind\" is identified as incorrect; the correct spelling is identified as \"friend\"." + "output_2": "The spelling of the given phrase \"freind\" is said to be incorrect; \"friend\" is stated as the correct spelling." }, { "instruction": "Select the noun phrase in the following sentence.", @@ -1053,7 +1053,7 @@ "instruction": "Convert 10 feet to meters.", "input": "", "output": "10 feet is equal to approximately 3.048 meters.", - "output_2": "Approximately 3.048 meters is equal to 10 feet." + "output_2": "Approximately 3.048 meters is equaled by 10 feet." }, { "instruction": "Simplify the given sentence.", @@ -1083,7 +1083,7 @@ "instruction": "Find the synonym for the given verb.", "input": "Begin", "output": "Commence", - "output_2": "The following text is to be converted to passive voice: Commence." + "output_2": "Be commenced." }, { "instruction": "Name 3 different animals that are active during the day.", @@ -1119,7 +1119,7 @@ "instruction": "Classify the following animal as carnivore, herbivore, or omnivore.", "input": "Deer", "output": "Herbivore", - "output_2": "I'm sorry, but the word \"Herbivore\" does not form a sentence and thus cannot be converted into passive voice. Passive voice requires a sentence with a clear subject, verb, and object, which is not applicable to a single noun." + "output_2": "I'm sorry, but the word \"Herbivore\" does not form a sentence and thus cannot be converted into passive voice. Passive voice requires a sentence with a clear subject, verb, and object, which is not present in a single noun." }, { "instruction": "Fix the following grammar mistake.", diff --git a/ch07/03_model-evaluation/config.json b/ch07/03_model-evaluation/config.json index c0bdf62..a01cb47 100644 --- a/ch07/03_model-evaluation/config.json +++ b/ch07/03_model-evaluation/config.json @@ -1,4 +1,4 @@ { "OPENAI_API_KEY": "sk-...", "_comment": "Enter your API key from https://platform.openai.com/api-keys" -} \ No newline at end of file +} From f86a929665cdac23d2379949261b10a128f66d69 Mon Sep 17 00:00:00 2001 From: rasbt Date: Mon, 27 May 2024 07:37:06 -0500 Subject: [PATCH 7/8] revert unnecessary changes --- .gitignore | 1 + ch03/01_main-chapter-code/multihead-attention.ipynb | 2 +- .../mha-implementations.ipynb | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ba38c30..47ed773 100644 --- a/.gitignore +++ b/.gitignore @@ -59,6 +59,7 @@ ch06/03_bonus_imdb-classification/test.csv ch06/03_bonus_imdb-classification/train.csv ch06/03_bonus_imdb-classification/validation.csv +ch07/02_dataset-utilities/instruction-examples-modified.json # Temporary OS-related files .DS_Store diff --git a/ch03/01_main-chapter-code/multihead-attention.ipynb b/ch03/01_main-chapter-code/multihead-attention.ipynb index 3cf719f..b788040 100644 --- a/ch03/01_main-chapter-code/multihead-attention.ipynb +++ b/ch03/01_main-chapter-code/multihead-attention.ipynb @@ -391,7 +391,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.11.4" } }, "nbformat": 4, diff --git a/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb b/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb index cd29166..82f5cde 100644 --- a/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb +++ b/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb @@ -1038,7 +1038,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.11.4" } }, "nbformat": 4, From 9a4861ee7fc06df23273249df23a7c2b8c866f94 Mon Sep 17 00:00:00 2001 From: rasbt Date: Mon, 27 May 2024 07:37:53 -0500 Subject: [PATCH 8/8] revert --- .../instruction-examples-modified.json | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/ch07/02_dataset-utilities/instruction-examples-modified.json b/ch07/02_dataset-utilities/instruction-examples-modified.json index 44f5418..333b83b 100644 --- a/ch07/02_dataset-utilities/instruction-examples-modified.json +++ b/ch07/02_dataset-utilities/instruction-examples-modified.json @@ -3,7 +3,7 @@ "instruction": "Identify the verb in the following sentence: The cat sleeps on the couch.", "input": "", "output": "The verb in the sentence is \"sleeps.\"", - "output_2": "The sentence is \"sleeps.\"" + "output_2": "The sentence is \"The verb in the sentence is slept.\"" }, { "instruction": "What is the plural form of \"goose\"?", @@ -63,7 +63,7 @@ "instruction": "Generate three adjectives to describe a mountain.", "input": "", "output": "1. Majestic\n2. Rugged\n3. Towering", - "output_2": "1. Majestic\n2. Rugged\n3. Towering\n\n(Note: The words provided are adjectives and do not have active or passive voice forms. Adjectives describe nouns and do not imply any action that can be converted between active and passive voice.)" + "output_2": "1. Majestic\n2. Rugged\n3. Towering\n\n(Note: The words provided are adjectives and not sentences, hence they cannot be converted into passive voice as they do not contain a verb.)" }, { "instruction": "Determine the state of matter for helium at room temperature.", @@ -81,7 +81,7 @@ "instruction": "What is the symbol for the chemical element iron?", "input": "", "output": "The symbol for the chemical element iron is Fe.", - "output_2": "The symbol Fe is used for the chemical element iron." + "output_2": "The symbol for the chemical element iron is represented by Fe." }, { "instruction": "Convert the sentence into a question by adding a question tag.", @@ -105,13 +105,13 @@ "instruction": "Provide a word that rhymes with \"care.\"", "input": "", "output": "A word that rhymes with \"care\" is \"fare.\"", - "output_2": "A word that \"fare\" rhymes with is \"care.\"" + "output_2": "A word with which \"care\" rhymes is \"fare.\"" }, { "instruction": "Rewrite this sentence to start with \"Despite\": She managed to finish her work, although she was tired.", "input": "", "output": "Despite being tired, she managed to finish her work.", - "output_2": "Despite being tired, her work was managed to be finished by her." + "output_2": "Despite being tired, the work was managed to be finished by her." }, { "instruction": "Convert the following sentence to use a relative clause: The man is a teacher. He lives next door.", @@ -147,7 +147,7 @@ "instruction": "Explain what a haiku is.", "input": "", "output": "A haiku is a form of traditional Japanese poetry that consists of three lines with a syllable pattern of 5-7-5.", - "output_2": "A form of traditional Japanese poetry that consists of three lines with a syllable pattern of 5-7-5 is known as a haiku." + "output_2": "A form of traditional Japanese poetry known as a haiku consists of three lines with a syllable pattern of 5-7-5." }, { "instruction": "Provide the past tense form of the verb \"run.\"", @@ -177,7 +177,7 @@ "instruction": "Name an antonym for \"joy.\"", "input": "", "output": "An antonym for \"joy\" is \"sorrow.\"", - "output_2": "An antonym for \"joy\" is identified as \"sorrow.\"" + "output_2": "An antonym for \"joy\" is considered to be \"sorrow.\"" }, { "instruction": "Classify the following items: apple, diamond, fern.", @@ -189,13 +189,13 @@ "instruction": "Generate three adjectives to describe the ocean.", "input": "", "output": "1. Vast\n2. Mysterious\n3. Serene", - "output_2": "1. Vastness is experienced.\n2. Mysteriousness is perceived.\n3. Serenity is felt." + "output_2": "1. Vast is remained.\n2. Mysterious is considered.\n3. Serene is felt." }, { "instruction": "Determine the state of matter for nitrogen at room temperature.", "input": "", "output": "Nitrogen is in a gaseous state at room temperature.", - "output_2": "At room temperature, nitrogen is found in a gaseous state." + "output_2": "At room temperature, nitrogen is in a gaseous state." }, { "instruction": "Convert the following statement into a question.", @@ -249,7 +249,7 @@ "instruction": "Rewrite the following sentence using passive voice.", "input": "The team achieved great results.", "output": "Great results were achieved by the team.", - "output_2": "Great results were achieved by the team." + "output_2": "The team achieved great results." }, { "instruction": "Edit the following sentence to make it more formal.", @@ -261,7 +261,7 @@ "instruction": "Arrange the given numbers in descending order.", "input": "7, 10, 3, 6, 9", "output": "10, 9, 7, 6, 3.", - "output_2": "10, 9, 7, 6, 3 were converted to passive voice." + "output_2": "10, 9, 7, 6, 3 were counted." }, { "instruction": "Given a sentence, convert it into indirect speech.", @@ -297,7 +297,7 @@ "instruction": "Change this sentence into the past continuous tense.", "input": "She sings in the choir.", "output": "She was singing in the choir.", - "output_2": "The choir was being sung in by her." + "output_2": "Singing in the choir was being done by her." }, { "instruction": "Make the first sentence a dependent clause.", @@ -327,7 +327,7 @@ "instruction": "Correct the grammatical errors in this sentence.", "input": "He don't know nothing about it.", "output": "He doesn't know anything about it.", - "output_2": "Nothing about it is known by him." + "output_2": "Anything about it is not known by him." }, { "instruction": "Rewrite the following sentence to remove redundancy.", @@ -381,13 +381,13 @@ "instruction": "Find a rhyming word for the word \"care.\"", "input": "", "output": "A rhyming word for the word \"care\" could be \"bare.\"", - "output_2": "A rhyming word for the word \"care\" could be \"bare\" is said." + "output_2": "A rhyming word for the word \"care\" could be \"bare\" by \"bare.\"" }, { "instruction": "Reword the following sentence to the future tense.", "input": "He is reading a novel inspired by his grandmother.", "output": "He will be reading a novel inspired by his grandmother.", - "output_2": "A novel inspired by his grandmother will be read by him." + "output_2": "A novel inspired by his grandmother will be being read by him." }, { "instruction": "Classify the following fruit according to its type.", @@ -561,7 +561,7 @@ "instruction": "Categorize the following sentence as either factual or opinion-based.", "input": "Chocolate is the best dessert.", "output": "Opinion-based.", - "output_2": "Based on opinion." + "output_2": "Opinion-based was written." }, { "instruction": "Classify each sentence as either declarative, interrogative, imperative, or exclamatory.", @@ -663,7 +663,7 @@ "instruction": "Label whether the following statements are true or false.", "input": "The moon is a planet.", "output": "False", - "output_2": "False is not a sentence and cannot be converted into passive voice." + "output_2": "False is not a sentence and therefore cannot be converted into passive voice." }, { "instruction": "Combine the given sentences into one cohesive sentence.", @@ -675,13 +675,13 @@ "instruction": "Rewrite the given passage in the past tense.", "input": "They are building a new library.", "output": "They built a new library.", - "output_2": "A new library was built by them." + "output_2": "A new library was built." }, { "instruction": "Change the following sentence so that it is in the past tense.", "input": "He runs to the store.", "output": "He ran to the store.", - "output_2": "To the store he was run." + "output_2": "The store was run to by him." }, { "instruction": "Edit the following sentence to remove all passive voice.", @@ -717,7 +717,7 @@ "instruction": "Classify the following online review as being positive or negative.", "input": "I found this book to be incredibly insightful and informative.", "output": "The online review is positive.", - "output_2": "A positive review is given online." + "output_2": "The online review is considered positive." }, { "instruction": "Reverse the following list alphabetically.", @@ -831,7 +831,7 @@ "instruction": "Find a synonym for the word 'start'.", "input": "", "output": "A synonym for the word 'start' could be \"commence.\"", - "output_2": "A synonym for the word 'start' could be \"commence\" by someone." + "output_2": "A synonym for the word 'start' could be \"commence\" by some." }, { "instruction": "Change the sentence \"This should not have happened\" into a declarative sentence.", @@ -867,7 +867,7 @@ "instruction": "Scramble the given phrase.", "input": "A random phrase", "output": "A nmaodr hrasep", - "output_2": "A nmaodr hrasep was converted." + "output_2": "A nmaodr hrasep was written." }, { "instruction": "rewrite this sentence as a question.", @@ -951,13 +951,13 @@ "instruction": "Rewrite the sentence to use a negative adverb.", "input": "She always remembers to call.", "output": "She never forgets to call.", - "output_2": "To call is never forgotten by her." + "output_2": "It is never forgotten by her to call." }, { "instruction": "Categorize the given list of animals.", "input": "Shark, Dolphin, Trout", "output": "Fish: Shark, Trout\nMammals: Dolphin", - "output_2": "Fish: Shark, Trout\nMammals: Dolphin" + "output_2": "Fish: Shark, Trout are listed.\nMammals: Dolphin is listed." }, { "instruction": "Rewrite the sentence using a synonym.", @@ -987,7 +987,7 @@ "instruction": "Evaluate the following phrase by transforming it into the spelling given.", "input": "freind --> friend", "output": "The spelling of the given phrase \"freind\" is incorrect, the correct spelling is \"friend\".", - "output_2": "The spelling of the given phrase \"freind\" is said to be incorrect; \"friend\" is stated as the correct spelling." + "output_2": "The spelling of the given phrase \"freind\" is identified as incorrect; the correct spelling is identified as \"friend\"." }, { "instruction": "Select the noun phrase in the following sentence.", @@ -1053,7 +1053,7 @@ "instruction": "Convert 10 feet to meters.", "input": "", "output": "10 feet is equal to approximately 3.048 meters.", - "output_2": "Approximately 3.048 meters is equaled by 10 feet." + "output_2": "Approximately 3.048 meters is equal to 10 feet." }, { "instruction": "Simplify the given sentence.", @@ -1083,7 +1083,7 @@ "instruction": "Find the synonym for the given verb.", "input": "Begin", "output": "Commence", - "output_2": "Be commenced." + "output_2": "The following text is to be converted to passive voice: Commence." }, { "instruction": "Name 3 different animals that are active during the day.", @@ -1119,7 +1119,7 @@ "instruction": "Classify the following animal as carnivore, herbivore, or omnivore.", "input": "Deer", "output": "Herbivore", - "output_2": "I'm sorry, but the word \"Herbivore\" does not form a sentence and thus cannot be converted into passive voice. Passive voice requires a sentence with a clear subject, verb, and object, which is not present in a single noun." + "output_2": "I'm sorry, but the word \"Herbivore\" does not form a sentence and thus cannot be converted into passive voice. Passive voice requires a sentence with a clear subject, verb, and object, which is not applicable to a single noun." }, { "instruction": "Fix the following grammar mistake.",