diff --git a/docs/2notebook/Example_5_Explain_BERT.ipynb b/docs/2notebook/Example_5_Explain_BERT.ipynb index 1ba148386..80ba05e31 100644 --- a/docs/2notebook/Example_5_Explain_BERT.ipynb +++ b/docs/2notebook/Example_5_Explain_BERT.ipynb @@ -68,23 +68,25 @@ "name": "stdout", "output_type": "stream", "text": [ - "Requirement already satisfied: captum in /p/qdata/jy2ma/miniconda3/envs/textattack-dev/lib/python3.8/site-packages (0.3.1)\n", - "Requirement already satisfied: torch>=1.2 in /p/qdata/jy2ma/miniconda3/envs/textattack-dev/lib/python3.8/site-packages (from captum) (1.8.1)\n", - "Requirement already satisfied: matplotlib in /p/qdata/jy2ma/miniconda3/envs/textattack-dev/lib/python3.8/site-packages (from captum) (3.4.1)\n", - "Requirement already satisfied: numpy in /p/qdata/jy2ma/miniconda3/envs/textattack-dev/lib/python3.8/site-packages (from captum) (1.18.5)\n", - "Requirement already satisfied: typing-extensions in /p/qdata/jy2ma/miniconda3/envs/textattack-dev/lib/python3.8/site-packages (from torch>=1.2->captum) (3.7.4.3)\n", - "Requirement already satisfied: cycler>=0.10 in /p/qdata/jy2ma/miniconda3/envs/textattack-dev/lib/python3.8/site-packages (from matplotlib->captum) (0.10.0)\n", - "Requirement already satisfied: pillow>=6.2.0 in /p/qdata/jy2ma/miniconda3/envs/textattack-dev/lib/python3.8/site-packages (from matplotlib->captum) (8.2.0)\n", - "Requirement already satisfied: kiwisolver>=1.0.1 in /p/qdata/jy2ma/miniconda3/envs/textattack-dev/lib/python3.8/site-packages (from matplotlib->captum) (1.3.1)\n", - "Requirement already satisfied: pyparsing>=2.2.1 in /p/qdata/jy2ma/miniconda3/envs/textattack-dev/lib/python3.8/site-packages (from matplotlib->captum) (2.4.7)\n", - "Requirement already satisfied: python-dateutil>=2.7 in /p/qdata/jy2ma/miniconda3/envs/textattack-dev/lib/python3.8/site-packages (from matplotlib->captum) (2.8.1)\n", - "Requirement already satisfied: six in /p/qdata/jy2ma/miniconda3/envs/textattack-dev/lib/python3.8/site-packages (from cycler>=0.10->matplotlib->captum) (1.15.0)\n" + "Requirement already satisfied: captum in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (0.4.0)\n", + "Requirement already satisfied: torch>=1.2 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from captum) (1.6.0)\n", + "Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from captum) (1.18.5)\n", + "Requirement already satisfied: matplotlib in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from captum) (3.3.3)\n", + "Requirement already satisfied: future in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from torch>=1.2->captum) (0.18.2)\n", + "Requirement already satisfied: cycler>=0.10 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib->captum) (0.10.0)\n", + "Requirement already satisfied: kiwisolver>=1.0.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib->captum) (1.3.1)\n", + "Requirement already satisfied: python-dateutil>=2.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib->captum) (2.8.1)\n", + "Requirement already satisfied: pillow>=6.2.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib->captum) (8.0.1)\n", + "Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib->captum) (2.4.7)\n", + "Requirement already satisfied: six in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from cycler>=0.10->matplotlib->captum) (1.15.0)\n", + "\u001b[33mWARNING: You are using pip version 20.1.1; however, version 21.2.1 is available.\n", + "You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -m pip install --upgrade pip' command.\u001b[0m\n" ] } ], "source": [ "#Optional: Install dependency CAptum\n", - "!pip install captum" + "!pip3 install captum" ] }, { @@ -114,14 +116,17 @@ "name": "stdout", "output_type": "stream", "text": [ - "cuda:0\n" + "cpu\n" ] } ], "source": [ - "device = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n", - "print(device)\n", - "torch.cuda.set_device(device) " + "if torch.cuda.is_available():\n", + " device = torch.device(\"cuda:0\")\n", + "else: \n", + " device = torch.device(\"cpu\")\n", + " \n", + "print(device)" ] }, { @@ -231,7 +236,7 @@ "output_type": "stream", "text": [ "Using custom data configuration default\n", - "Reusing dataset ag_news (/p/qdata/jy2ma/.cache/textattack/datasets/ag_news/default/0.0.0/0eeeaaa5fb6dffd81458e293dfea1adba2881ffcbdc3fb56baeb5a892566c29a)\n", + "Reusing dataset ag_news (/Users/ccy/.cache/huggingface/datasets/ag_news/default/0.0.0/fb5c5e74a110037311ef5e904583ce9f8b9fbc1354290f97b4929f01b3f48b1a)\n", "textattack: Loading \u001b[94mdatasets\u001b[0m dataset \u001b[94mag_news\u001b[0m, split \u001b[94mtrain\u001b[0m.\n" ] } @@ -245,40 +250,11 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 7, "metadata": { "id": "Ncxq0UCtkXjZ" }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'input_ids': tensor([[ 101, 2813, 2358, 1012, 6468, 15020, 2067, 2046, 1996, 2304,\n", - " 1006, 26665, 1007, 26665, 1011, 2460, 1011, 19041, 1010, 2813,\n", - " 2395, 1005, 1055, 1040, 11101, 2989, 1032, 2316, 1997, 11087,\n", - " 1011, 22330, 8713, 2015, 1010, 2024, 3773, 2665, 2153, 1012,\n", - " 102, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", - " 0, 0, 0],\n", - " [ 101, 18431, 2571, 3504, 2646, 3293, 13395, 1006, 26665, 1007,\n", - " 26665, 1011, 2797, 5211, 3813, 18431, 2571, 2177, 1010, 1032,\n", - " 2029, 2038, 1037, 5891, 2005, 2437, 2092, 1011, 22313, 1998,\n", - " 5681, 1032, 6801, 3248, 1999, 1996, 3639, 3068, 1010, 2038,\n", - " 5168, 2872, 1032, 2049, 29475, 2006, 2178, 2112, 1997, 1996,\n", - " 3006, 1012, 102]]), 'token_type_ids': tensor([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", - " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", - " 0, 0, 0, 0, 0],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", - " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", - " 0, 0, 0, 0, 0]]), 'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n", - " 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,\n", - " 0, 0, 0, 0, 0],\n", - " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n", - " 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n", - " 1, 1, 1, 1, 1]])}\n" - ] - } - ], + "outputs": [], "source": [ "def get_text(tokenizer,input_ids,token_type_ids,attention_mask):\n", " list_of_text = []\n", @@ -325,7 +301,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 8, "metadata": { "id": "ao-XxS1xkXja" }, @@ -337,7 +313,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 9, "metadata": { "colab": { "base_uri": "https://localhost:8080/" @@ -361,7 +337,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 10, "metadata": { "colab": { "base_uri": "https://localhost:8080/" @@ -374,7 +350,8 @@ "name": "stderr", "output_type": "stream", "text": [ - " 0%| | 0/10 [00:00 \u001b[35mSci/tech (68%)\u001b[0m\n", + "[[Business (96%)]] --> [[Sci/tech (68%)]]\n", "\n", - "Wall St. \u001b[94mBears\u001b[0m Claw Back Into the \u001b[94mBlack\u001b[0m (Reuters) Reuters - Short-sellers, Wall Street's \u001b[94mdwindling\u001b[0m\\\u001b[94mband\u001b[0m of ultra-cynics, are \u001b[94mseeing\u001b[0m \u001b[94mgreen\u001b[0m again.\n", + "Wall St. [[Bears]] Claw Back Into the [[Black]] (Reuters) Reuters - Short-sellers, Wall Street's [[dwindling]]\\[[band]] of ultra-cynics, are [[seeing]] [[green]] again.\n", "\n", - "Wall St. \u001b[35msuffer\u001b[0m Claw Back Into the \u001b[35mlightlessness\u001b[0m (Reuters) Reuters - Short-sellers, Wall Street's \u001b[35mdwindle\u001b[0m\\\u001b[35misthmus\u001b[0m of ultra-cynics, are \u001b[35mexamine\u001b[0m \u001b[35mgreenish\u001b[0m again.\n", + "Wall St. [[suffer]] Claw Back Into the [[lightlessness]] (Reuters) Reuters - Short-sellers, Wall Street's [[dwindle]]\\[[isthmus]] of ultra-cynics, are [[examine]] [[greenish]] again.\n", "\n", "\n" ] @@ -420,7 +397,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "[Succeeded / Failed / Skipped / Total] 2 / 0 / 0 / 2: 20%|██ | 2/10 [00:10<00:40, 5.07s/it]" + "[Succeeded / Failed / Skipped / Total] 2 / 0 / 0 / 2: 20%|█████████████████████▏ | 2/10 [21:10<1:24:40, 635.08s/it]" ] }, { @@ -428,11 +405,11 @@ "output_type": "stream", "text": [ "--------------------------------------------- Result 2 ---------------------------------------------\n", - "\u001b[94mBusiness (100%)\u001b[0m --> \u001b[35mSci/tech (50%)\u001b[0m\n", + "[[Business (100%)]] --> [[Sci/tech (50%)]]\n", "\n", - "Carlyle Looks Toward Commercial Aerospace (Reuters) Reuters - Private \u001b[94minvestment\u001b[0m firm Carlyle Group,\\which has a reputation for \u001b[94mmaking\u001b[0m well-timed and occasionally\\controversial plays in the \u001b[94mdefense\u001b[0m industry, has quietly \u001b[94mplaced\u001b[0m\\its bets on another part of the market.\n", + "Carlyle Looks Toward Commercial Aerospace (Reuters) Reuters - Private [[investment]] firm Carlyle Group,\\which has a reputation for [[making]] well-timed and occasionally\\controversial plays in the [[defense]] industry, has quietly [[placed]]\\its bets on another part of the market.\n", "\n", - "Carlyle Looks Toward Commercial Aerospace (Reuters) Reuters - Private \u001b[35minvestiture\u001b[0m firm Carlyle Group,\\which has a reputation for \u001b[35mca-ca\u001b[0m well-timed and occasionally\\controversial plays in the \u001b[35mdenial\u001b[0m industry, has quietly \u001b[35msite\u001b[0m\\its bets on another part of the market.\n", + "Carlyle Looks Toward Commercial Aerospace (Reuters) Reuters - Private [[investiture]] firm Carlyle Group,\\which has a reputation for [[ca-ca]] well-timed and occasionally\\controversial plays in the [[denial]] industry, has quietly [[site]]\\its bets on another part of the market.\n", "\n", "\n" ] @@ -441,7 +418,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "[Succeeded / Failed / Skipped / Total] 3 / 0 / 0 / 3: 30%|███ | 3/10 [00:14<00:33, 4.74s/it]" + "[Succeeded / Failed / Skipped / Total] 3 / 0 / 0 / 3: 30%|███████████████████████████████▊ | 3/10 [28:14<1:05:52, 564.68s/it]" ] }, { @@ -449,11 +426,11 @@ "output_type": "stream", "text": [ "--------------------------------------------- Result 3 ---------------------------------------------\n", - "\u001b[94mBusiness (100%)\u001b[0m --> \u001b[35mSci/tech (100%)\u001b[0m\n", + "[[Business (100%)]] --> [[Sci/tech (100%)]]\n", "\n", - "Oil and Economy \u001b[94mCloud\u001b[0m Stocks' Outlook (Reuters) Reuters - Soaring crude prices plus worries\\about the economy and the outlook for \u001b[94mearnings\u001b[0m are expected to\\hang over the \u001b[94mstock\u001b[0m market next week during the depth of the\\summer doldrums.\n", + "Oil and Economy [[Cloud]] Stocks' Outlook (Reuters) Reuters - Soaring crude prices plus worries\\about the economy and the outlook for [[earnings]] are expected to\\hang over the [[stock]] market next week during the depth of the\\summer doldrums.\n", "\n", - "Oil and Economy \u001b[35mswarm\u001b[0m Stocks' Outlook (Reuters) Reuters - Soaring crude prices plus worries\\about the economy and the outlook for \u001b[35mlucre\u001b[0m are expected to\\hang over the \u001b[35mgillyflower\u001b[0m market next week during the depth of the\\summer doldrums.\n", + "Oil and Economy [[swarm]] Stocks' Outlook (Reuters) Reuters - Soaring crude prices plus worries\\about the economy and the outlook for [[lucre]] are expected to\\hang over the [[gillyflower]] market next week during the depth of the\\summer doldrums.\n", "\n", "\n" ] @@ -462,7 +439,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "[Succeeded / Failed / Skipped / Total] 4 / 0 / 0 / 4: 40%|████ | 4/10 [00:18<00:27, 4.66s/it]" + "[Succeeded / Failed / Skipped / Total] 4 / 0 / 0 / 4: 40%|███████████████████████████████████████████▏ | 4/10 [36:03<54:05, 541.00s/it]" ] }, { @@ -470,11 +447,11 @@ "output_type": "stream", "text": [ "--------------------------------------------- Result 4 ---------------------------------------------\n", - "\u001b[94mBusiness (78%)\u001b[0m --> \u001b[91mWorld (58%)\u001b[0m\n", + "[[Business (78%)]] --> [[World (58%)]]\n", "\n", - "Iraq \u001b[94mHalts\u001b[0m Oil Exports from Main Southern Pipeline (Reuters) Reuters - Authorities have halted oil export\\\u001b[94mflows\u001b[0m from the main pipeline in southern \u001b[94mIraq\u001b[0m after\\intelligence showed a rebel militia could \u001b[94mstrike\u001b[0m\\infrastructure, an oil official said on Saturday.\n", + "Iraq [[Halts]] Oil Exports from Main Southern Pipeline (Reuters) Reuters - Authorities have halted oil export\\[[flows]] from the main pipeline in southern [[Iraq]] after\\intelligence showed a rebel militia could [[strike]]\\infrastructure, an oil official said on Saturday.\n", "\n", - "Iraq \u001b[91mkibosh\u001b[0m Oil Exports from Main Southern Pipeline (Reuters) Reuters - Authorities have halted oil export\\\u001b[91mhang\u001b[0m from the main pipeline in southern \u001b[91mIrak\u001b[0m after\\intelligence showed a rebel militia could \u001b[91mfall\u001b[0m\\infrastructure, an oil official said on Saturday.\n", + "Iraq [[kibosh]] Oil Exports from Main Southern Pipeline (Reuters) Reuters - Authorities have halted oil export\\[[hang]] from the main pipeline in southern [[Irak]] after\\intelligence showed a rebel militia could [[fall]]\\infrastructure, an oil official said on Saturday.\n", "\n", "\n" ] @@ -483,7 +460,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "[Succeeded / Failed / Skipped / Total] 5 / 0 / 0 / 5: 50%|█████ | 5/10 [00:23<00:23, 4.65s/it]" + "[Succeeded / Failed / Skipped / Total] 5 / 0 / 0 / 5: 50%|██████████████████████████████████████████████████████ | 5/10 [42:59<42:59, 515.83s/it]" ] }, { @@ -491,11 +468,11 @@ "output_type": "stream", "text": [ "--------------------------------------------- Result 5 ---------------------------------------------\n", - "\u001b[94mBusiness (99%)\u001b[0m --> \u001b[91mWorld (82%)\u001b[0m\n", + "[[Business (99%)]] --> [[World (82%)]]\n", "\n", - "Oil prices soar to all-time record, posing new menace to \u001b[94mUS\u001b[0m \u001b[94meconomy\u001b[0m (AFP) AFP - Tearaway world oil prices, toppling records and straining wallets, present a new economic menace barely three months before the US presidential elections.\n", + "Oil prices soar to all-time record, posing new menace to [[US]] [[economy]] (AFP) AFP - Tearaway world oil prices, toppling records and straining wallets, present a new economic menace barely three months before the US presidential elections.\n", "\n", - "Oil prices soar to all-time record, posing new menace to \u001b[91muranium\u001b[0m \u001b[91mthriftiness\u001b[0m (AFP) AFP - Tearaway world oil prices, toppling records and straining wallets, present a new economic menace barely three months before the US presidential elections.\n", + "Oil prices soar to all-time record, posing new menace to [[uranium]] [[thriftiness]] (AFP) AFP - Tearaway world oil prices, toppling records and straining wallets, present a new economic menace barely three months before the US presidential elections.\n", "\n", "\n" ] @@ -504,7 +481,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "[Succeeded / Failed / Skipped / Total] 6 / 0 / 0 / 6: 60%|██████ | 6/10 [00:30<00:20, 5.13s/it]" + "[Succeeded / Failed / Skipped / Total] 6 / 0 / 0 / 6: 60%|████████████████████████████████████████████████████████████████▊ | 6/10 [56:56<37:57, 569.40s/it]" ] }, { @@ -512,11 +489,11 @@ "output_type": "stream", "text": [ "--------------------------------------------- Result 6 ---------------------------------------------\n", - "\u001b[94mBusiness (100%)\u001b[0m --> \u001b[35mSci/tech (55%)\u001b[0m\n", + "[[Business (100%)]] --> [[Sci/tech (55%)]]\n", "\n", - "\u001b[94mStocks\u001b[0m \u001b[94mEnd\u001b[0m Up, But Near Year Lows (Reuters) Reuters - \u001b[94mStocks\u001b[0m \u001b[94mended\u001b[0m slightly higher on Friday\\but \u001b[94mstayed\u001b[0m \u001b[94mnear\u001b[0m \u001b[94mlows\u001b[0m for the year as \u001b[94moil\u001b[0m prices surged past #36;\u001b[94m46\u001b[0m\\a \u001b[94mbarrel\u001b[0m, \u001b[94moffsetting\u001b[0m a \u001b[94mpositive\u001b[0m \u001b[94moutlook\u001b[0m from computer \u001b[94mmaker\u001b[0m\\Dell Inc. (DELL.O)\n", + "[[Stocks]] [[End]] Up, But Near Year Lows (Reuters) Reuters - [[Stocks]] [[ended]] slightly higher on Friday\\but [[stayed]] [[near]] [[lows]] for the year as [[oil]] prices surged past #36;[[46]]\\a [[barrel]], [[offsetting]] a [[positive]] [[outlook]] from computer [[maker]]\\Dell Inc. (DELL.O)\n", "\n", - "\u001b[35mstock\u001b[0m \u001b[35mterminate\u001b[0m Up, But Near Year Lows (Reuters) Reuters - \u001b[35minventory\u001b[0m \u001b[35mterminate\u001b[0m slightly higher on Friday\\but \u001b[35mcontinue\u001b[0m \u001b[35mvirtually\u001b[0m \u001b[35mmoo\u001b[0m for the year as \u001b[35membrocate\u001b[0m prices surged past #36;\u001b[35mxlvi\u001b[0m\\a \u001b[35mdrum\u001b[0m, \u001b[35mcancel\u001b[0m a \u001b[35mincontrovertible\u001b[0m \u001b[35mmindset\u001b[0m from computer \u001b[35mCreator\u001b[0m\\Dell Inc. (DELL.O)\n", + "[[stock]] [[terminate]] Up, But Near Year Lows (Reuters) Reuters - [[inventory]] [[terminate]] slightly higher on Friday\\but [[continue]] [[virtually]] [[moo]] for the year as [[embrocate]] prices surged past #36;[[xlvi]]\\a [[drum]], [[cancel]] a [[incontrovertible]] [[mindset]] from computer [[Creator]]\\Dell Inc. (DELL.O)\n", "\n", "\n" ] @@ -525,7 +502,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "[Succeeded / Failed / Skipped / Total] 7 / 0 / 0 / 7: 70%|███████ | 7/10 [00:36<00:15, 5.15s/it]" + "[Succeeded / Failed / Skipped / Total] 7 / 0 / 0 / 7: 70%|██████████████████████████████████████████████████████████████████████████▏ | 7/10 [1:06:29<28:29, 569.87s/it]" ] }, { @@ -533,11 +510,11 @@ "output_type": "stream", "text": [ "--------------------------------------------- Result 7 ---------------------------------------------\n", - "\u001b[94mBusiness (100%)\u001b[0m --> \u001b[91mWorld (76%)\u001b[0m\n", + "[[Business (100%)]] --> [[World (76%)]]\n", "\n", - "Money Funds \u001b[94mFell\u001b[0m in \u001b[94mLatest\u001b[0m \u001b[94mWeek\u001b[0m (AP) AP - \u001b[94mAssets\u001b[0m of the nation's retail money \u001b[94mmarket\u001b[0m \u001b[94mmutual\u001b[0m funds \u001b[94mfell\u001b[0m by #36;1.17 \u001b[94mbillion\u001b[0m in the latest week to #36;849.98 \u001b[94mtrillion\u001b[0m, the Investment Company \u001b[94mInstitute\u001b[0m \u001b[94msaid\u001b[0m Thursday.\n", + "Money Funds [[Fell]] in [[Latest]] [[Week]] (AP) AP - [[Assets]] of the nation's retail money [[market]] [[mutual]] funds [[fell]] by #36;1.17 [[billion]] in the latest week to #36;849.98 [[trillion]], the Investment Company [[Institute]] [[said]] Thursday.\n", "\n", - "Money Funds \u001b[91mhide\u001b[0m in \u001b[91mup-to-the-minute\u001b[0m \u001b[91mhebdomad\u001b[0m (AP) AP - \u001b[91masset\u001b[0m of the nation's retail money \u001b[91mcommercialise\u001b[0m \u001b[91mcommon\u001b[0m funds \u001b[91mcruel\u001b[0m by #36;1.17 \u001b[91mgazillion\u001b[0m in the latest week to #36;849.98 \u001b[91m1000000000000\u001b[0m, the Investment Company \u001b[91mconstitute\u001b[0m \u001b[91mstate\u001b[0m Thursday.\n", + "Money Funds [[hide]] in [[up-to-the-minute]] [[hebdomad]] (AP) AP - [[asset]] of the nation's retail money [[commercialise]] [[common]] funds [[cruel]] by #36;1.17 [[gazillion]] in the latest week to #36;849.98 [[1000000000000]], the Investment Company [[constitute]] [[state]] Thursday.\n", "\n", "\n" ] @@ -546,7 +523,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "[Succeeded / Failed / Skipped / Total] 8 / 0 / 0 / 8: 80%|████████ | 8/10 [00:43<00:10, 5.40s/it]" + "[Succeeded / Failed / Skipped / Total] 8 / 0 / 0 / 8: 80%|████████████████████████████████████████████████████████████████████████████████████▊ | 8/10 [1:17:31<19:22, 581.46s/it]" ] }, { @@ -554,11 +531,11 @@ "output_type": "stream", "text": [ "--------------------------------------------- Result 8 ---------------------------------------------\n", - "\u001b[94mBusiness (100%)\u001b[0m --> \u001b[91mWorld (76%)\u001b[0m\n", + "[[Business (100%)]] --> [[World (76%)]]\n", "\n", - "\u001b[94mFed\u001b[0m \u001b[94mminutes\u001b[0m \u001b[94mshow\u001b[0m \u001b[94mdissent\u001b[0m over inflation (USATODAY.com) USATODAY.com - Retail sales \u001b[94mbounced\u001b[0m \u001b[94mback\u001b[0m a bit in July, and \u001b[94mnew\u001b[0m claims for jobless \u001b[94mbenefits\u001b[0m fell \u001b[94mlast\u001b[0m \u001b[94mweek\u001b[0m, the government said Thursday, indicating the economy is \u001b[94mimproving\u001b[0m from a midsummer slump.\n", + "[[Fed]] [[minutes]] [[show]] [[dissent]] over inflation (USATODAY.com) USATODAY.com - Retail sales [[bounced]] [[back]] a bit in July, and [[new]] claims for jobless [[benefits]] fell [[last]] [[week]], the government said Thursday, indicating the economy is [[improving]] from a midsummer slump.\n", "\n", - "\u001b[91meat\u001b[0m \u001b[91mhour\u001b[0m \u001b[91mtestify\u001b[0m \u001b[91mprotest\u001b[0m over inflation (USATODAY.com) USATODAY.com - Retail sales \u001b[91mbound\u001b[0m \u001b[91mhind\u001b[0m a bit in July, and \u001b[91myoung\u001b[0m claims for jobless \u001b[91mwelfare\u001b[0m fell \u001b[91mdeath\u001b[0m \u001b[91mworkweek\u001b[0m, the government said Thursday, indicating the economy is \u001b[91mamend\u001b[0m from a midsummer slump.\n", + "[[eat]] [[hour]] [[testify]] [[protest]] over inflation (USATODAY.com) USATODAY.com - Retail sales [[bound]] [[hind]] a bit in July, and [[young]] claims for jobless [[welfare]] fell [[death]] [[workweek]], the government said Thursday, indicating the economy is [[amend]] from a midsummer slump.\n", "\n", "\n" ] @@ -567,7 +544,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "[Succeeded / Failed / Skipped / Total] 9 / 0 / 0 / 9: 90%|█████████ | 9/10 [00:49<00:05, 5.51s/it]" + "[Succeeded / Failed / Skipped / Total] 9 / 0 / 0 / 9: 90%|███████████████████████████████████████████████████████████████████████████████████████████████▍ | 9/10 [1:28:33<09:50, 590.35s/it]" ] }, { @@ -575,11 +552,11 @@ "output_type": "stream", "text": [ "--------------------------------------------- Result 9 ---------------------------------------------\n", - "\u001b[94mBusiness (100%)\u001b[0m --> \u001b[35mSci/tech (100%)\u001b[0m\n", + "[[Business (100%)]] --> [[Sci/tech (100%)]]\n", "\n", - "Safety \u001b[94mNet\u001b[0m (Forbes.com) Forbes.com - After earning a PH.D. in Sociology, Danny Bazil Riley started to work as the general manager at a commercial real estate firm at an annual base salary of #36;70,000. Soon after, a financial planner stopped by his desk to drop off brochures about insurance benefits available through his employer. But, at 32, \"buying insurance was the furthest thing from my mind,\" says Riley.\n", + "Safety [[Net]] (Forbes.com) Forbes.com - After earning a PH.D. in Sociology, Danny Bazil Riley started to work as the general manager at a commercial real estate firm at an annual base salary of #36;70,000. Soon after, a financial planner stopped by his desk to drop off brochures about insurance benefits available through his employer. But, at 32, \"buying insurance was the furthest thing from my mind,\" says Riley.\n", "\n", - "Safety \u001b[35mcyberspace\u001b[0m (Forbes.com) Forbes.com - After earning a PH.D. in Sociology, Danny Bazil Riley started to work as the general manager at a commercial real estate firm at an annual base salary of #36;70,000. Soon after, a financial planner stopped by his desk to drop off brochures about insurance benefits available through his employer. But, at 32, \"buying insurance was the furthest thing from my mind,\" says Riley.\n", + "Safety [[cyberspace]] (Forbes.com) Forbes.com - After earning a PH.D. in Sociology, Danny Bazil Riley started to work as the general manager at a commercial real estate firm at an annual base salary of #36;70,000. Soon after, a financial planner stopped by his desk to drop off brochures about insurance benefits available through his employer. But, at 32, \"buying insurance was the furthest thing from my mind,\" says Riley.\n", "\n", "\n" ] @@ -588,7 +565,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "[Succeeded / Failed / Skipped / Total] 10 / 0 / 0 / 10: 100%|██████████| 10/10 [00:53<00:00, 5.32s/it]" + "[Succeeded / Failed / Skipped / Total] 10 / 0 / 0 / 10: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [1:34:51<00:00, 569.19s/it]" ] }, { @@ -596,11 +573,11 @@ "output_type": "stream", "text": [ "--------------------------------------------- Result 10 ---------------------------------------------\n", - "\u001b[94mBusiness (100%)\u001b[0m --> \u001b[91mWorld (71%)\u001b[0m\n", + "[[Business (100%)]] --> [[World (71%)]]\n", "\n", - "Wall St. Bears \u001b[94mClaw\u001b[0m Back Into the Black \u001b[94mNEW\u001b[0m YORK (Reuters) - Short-sellers, Wall Street's dwindling band of ultra-cynics, are seeing green again.\n", + "Wall St. Bears [[Claw]] Back Into the Black [[NEW]] YORK (Reuters) - Short-sellers, Wall Street's dwindling band of ultra-cynics, are seeing green again.\n", "\n", - "Wall St. Bears \u001b[91mchela\u001b[0m Back Into the Black \u001b[91mnovel\u001b[0m YORK (Reuters) - Short-sellers, Wall Street's dwindling band of ultra-cynics, are seeing green again.\n", + "Wall St. Bears [[chela]] Back Into the Black [[novel]] YORK (Reuters) - Short-sellers, Wall Street's dwindling band of ultra-cynics, are seeing green again.\n", "\n", "\n", "\n", @@ -616,7 +593,7 @@ "| Average perturbed word %: | 16.33% |\n", "| Average num. words per input: | 38.5 |\n", "| Avg num queries: | 331.8 |\n", - "+-------------------------------+--------+\n" + "+-------------------------------+--------+" ] }, { @@ -626,22 +603,29 @@ "\n" ] }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + }, { "data": { "text/plain": [ - "[,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ]" + "[,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ]" ] }, - "execution_count": 16, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -662,7 +646,7 @@ "provenance": [] }, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -676,7 +660,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.8" + "version": "3.7.9" }, "widgets": { "application/vnd.jupyter.widget-state+json": {