diff --git a/appendix-E/01_main-chapter-code/appendix-E.ipynb b/appendix-E/01_main-chapter-code/appendix-E.ipynb index a479c87..a9a52b6 100644 --- a/appendix-E/01_main-chapter-code/appendix-E.ipynb +++ b/appendix-E/01_main-chapter-code/appendix-E.ipynb @@ -170,7 +170,7 @@ "from pathlib import Path\n", "import pandas as pd\n", "from previous_chapters import (\n", - " download_and_unzip,\n", + " download_and_unzip_spam_data,\n", " create_balanced_dataset,\n", " random_split\n", ")\n", @@ -181,7 +181,7 @@ "extracted_path = \"sms_spam_collection\"\n", "data_file_path = Path(extracted_path) / \"SMSSpamCollection.tsv\"\n", "\n", - "download_and_unzip(url, zip_path, extracted_path, data_file_path)\n", + "download_and_unzip_spam_data(url, zip_path, extracted_path, data_file_path)\n", "\n", "df = pd.read_csv(data_file_path, sep=\"\\t\", header=None, names=[\"Label\", \"Text\"])\n", "balanced_df = create_balanced_dataset(df)\n", @@ -1415,7 +1415,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.10.6" } }, "nbformat": 4, diff --git a/appendix-E/01_main-chapter-code/previous_chapters.py b/appendix-E/01_main-chapter-code/previous_chapters.py index 9d7f7e3..f62ecbd 100644 --- a/appendix-E/01_main-chapter-code/previous_chapters.py +++ b/appendix-E/01_main-chapter-code/previous_chapters.py @@ -362,7 +362,7 @@ def evaluate_model(model, train_loader, val_loader, device, eval_iter): ##################################### -def download_and_unzip(url, zip_path, extracted_path, data_file_path): +def download_and_unzip_spam_data(url, zip_path, extracted_path, data_file_path): if data_file_path.exists(): print(f"{data_file_path} already exists. Skipping download and extraction.") return diff --git a/ch06/01_main-chapter-code/ch06.ipynb b/ch06/01_main-chapter-code/ch06.ipynb index 3922ba8..4668ead 100644 --- a/ch06/01_main-chapter-code/ch06.ipynb +++ b/ch06/01_main-chapter-code/ch06.ipynb @@ -187,7 +187,7 @@ "extracted_path = \"sms_spam_collection\"\n", "data_file_path = Path(extracted_path) / \"SMSSpamCollection.tsv\"\n", "\n", - "def download_and_unzip(url, zip_path, extracted_path, data_file_path):\n", + "def download_and_unzip_spam_data(url, zip_path, extracted_path, data_file_path):\n", " if data_file_path.exists():\n", " print(f\"{data_file_path} already exists. Skipping download and extraction.\")\n", " return\n", @@ -206,7 +206,7 @@ " os.rename(original_file_path, data_file_path)\n", " print(f\"File downloaded and saved as {data_file_path}\")\n", "\n", - "download_and_unzip(url, zip_path, extracted_path, data_file_path)" + "download_and_unzip_spam_data(url, zip_path, extracted_path, data_file_path)" ] }, { @@ -2347,7 +2347,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.10.6" } }, "nbformat": 4, diff --git a/ch06/03_bonus_imdb-classification/sklearn-baseline.ipynb b/ch06/03_bonus_imdb-classification/sklearn-baseline.ipynb index c5d217d..842ea82 100644 --- a/ch06/03_bonus_imdb-classification/sklearn-baseline.ipynb +++ b/ch06/03_bonus_imdb-classification/sklearn-baseline.ipynb @@ -46,7 +46,7 @@ " print(f\"File download and saved as {new_file_path}\")\n", "\n", "# Execute the function\n", - "download_and_unzip(url, zip_path, extract_to, new_file_path)" + "download_and_unzip_spam_data(url, zip_path, extract_to, new_file_path)" ] }, { @@ -510,7 +510,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.10.6" } }, "nbformat": 4,