|
43 | 43 | }, |
44 | 44 | { |
45 | 45 | "cell_type": "code", |
46 | | - "execution_count": null, |
| 46 | + "execution_count": 1, |
47 | 47 | "metadata": { |
48 | 48 | "id": "5AXyxiLD4X93" |
49 | 49 | }, |
50 | 50 | "outputs": [], |
51 | 51 | "source": [ |
52 | | - "!pip install textattack\n", |
53 | | - "!pip install torch==1.6\n", |
54 | | - "\n", |
55 | 52 | "# import transformations, contraints, and the Augmenter\n", |
56 | 53 | "from textattack.transformations import WordSwapRandomCharacterDeletion\n", |
57 | 54 | "from textattack.transformations import WordSwapQWERTY\n", |
|
65 | 62 | }, |
66 | 63 | { |
67 | 64 | "cell_type": "code", |
68 | | - "execution_count": null, |
| 65 | + "execution_count": 2, |
69 | 66 | "metadata": { |
70 | 67 | "colab": { |
71 | 68 | "base_uri": "https://localhost:8080/" |
|
77 | 74 | { |
78 | 75 | "data": { |
79 | 76 | "text/plain": [ |
80 | | - "['Wat I cannog crexte, I do not ubderstand.',\n", |
81 | | - " 'Wat I cnnot creae, I do not understanr.',\n", |
82 | | - " 'Wha I canno ceeate, I do not ubderstand.',\n", |
83 | | - " 'Whaf I camnot creatr, I do not understsnd.',\n", |
84 | | - " 'Wht I cannt crete, I do not undrstand.',\n", |
85 | | - " 'Wht I cnnot crewte, I do not undersyand.',\n", |
86 | | - " 'Whzt I cannlt creare, I do not understajd.',\n", |
87 | | - " 'Wuat I cannof cfeate, I do not undefstand.',\n", |
88 | | - " 'Wuat I cannoy ceate, I do not ubderstand.',\n", |
89 | | - " 'hat I annot cfeate, I do not undestand.']" |
| 77 | + "['Ahat I camnot reate, I do not unerstand.',\n", |
| 78 | + " 'Ahat I cwnnot crewte, I do not undefstand.',\n", |
| 79 | + " 'Wat I camnot vreate, I do not undefstand.',\n", |
| 80 | + " 'Wha I annot crate, I do not unerstand.',\n", |
| 81 | + " 'Whaf I canno creatr, I do not ynderstand.',\n", |
| 82 | + " 'Wtat I cannor dreate, I do not understwnd.',\n", |
| 83 | + " 'Wuat I canno ceate, I do not unferstand.',\n", |
| 84 | + " 'hat I cnnot ceate, I do not undersand.',\n", |
| 85 | + " 'hat I cnnot cfeate, I do not undfrstand.',\n", |
| 86 | + " 'hat I cwnnot crfate, I do not ujderstand.']" |
90 | 87 | ] |
91 | 88 | }, |
92 | | - "execution_count": 19, |
93 | | - "metadata": { |
94 | | - "tags": [] |
95 | | - }, |
| 89 | + "execution_count": 2, |
| 90 | + "metadata": {}, |
96 | 91 | "output_type": "execute_result" |
97 | 92 | } |
98 | 93 | ], |
|
130 | 125 | }, |
131 | 126 | { |
132 | 127 | "cell_type": "code", |
133 | | - "execution_count": null, |
| 128 | + "execution_count": 3, |
134 | 129 | "metadata": { |
135 | 130 | "colab": { |
136 | 131 | "base_uri": "https://localhost:8080/" |
|
139 | 134 | "outputId": "cd5ffc65-ca80-45cd-b3bb-d023bcad09a4" |
140 | 135 | }, |
141 | 136 | "outputs": [ |
| 137 | + { |
| 138 | + "name": "stdout", |
| 139 | + "output_type": "stream", |
| 140 | + "text": [ |
| 141 | + "2021-06-09 16:58:41,816 --------------------------------------------------------------------------------\n", |
| 142 | + "2021-06-09 16:58:41,817 The model key 'ner' now maps to 'https://huggingface.co/flair/ner-english' on the HuggingFace ModelHub\n", |
| 143 | + "2021-06-09 16:58:41,817 - The most current version of the model is automatically downloaded from there.\n", |
| 144 | + "2021-06-09 16:58:41,818 - (you can alternatively manually download the original model at https://nlp.informatik.hu-berlin.de/resources/models/ner/en-ner-conll03-v0.4.pt)\n", |
| 145 | + "2021-06-09 16:58:41,818 --------------------------------------------------------------------------------\n", |
| 146 | + "2021-06-09 16:58:41,906 loading file /u/lab/jy2ma/.flair/models/ner-english/4f4cdab26f24cb98b732b389e6cebc646c36f54cfd6e0b7d3b90b25656e4262f.8baa8ae8795f4df80b28e7f7b61d788ecbb057d1dc85aacb316f1bd02837a4a4\n" |
| 147 | + ] |
| 148 | + }, |
142 | 149 | { |
143 | 150 | "data": { |
144 | 151 | "text/plain": [ |
145 | | - "['I would love to go to Central African Republic but the tickets are 500 dollars',\n", |
146 | | - " 'I would love to go to Japan but the tickets are 707 dollars',\n", |
147 | | - " 'I would love to go to Kosovo but the tickets are 500 dollars',\n", |
148 | | - " \"I'd love to go to Dominica but the tickets are 437 dollars\",\n", |
149 | | - " \"I'd love to go to New Caledonia but the tickets are 697 dollars\"]" |
| 152 | + "['I would love to go to Chile but the tickets are 500 dollars',\n", |
| 153 | + " 'I would love to go to Japan but the tickets are 500 dollars',\n", |
| 154 | + " 'I would love to go to Japan but the tickets are 75 dollars',\n", |
| 155 | + " \"I'd love to go to Oman but the tickets are 373 dollars\",\n", |
| 156 | + " \"I'd love to go to Vietnam but the tickets are 613 dollars\"]" |
150 | 157 | ] |
151 | 158 | }, |
152 | | - "execution_count": 5, |
153 | | - "metadata": { |
154 | | - "tags": [] |
155 | | - }, |
| 159 | + "execution_count": 3, |
| 160 | + "metadata": {}, |
156 | 161 | "output_type": "execute_result" |
157 | 162 | } |
158 | 163 | ], |
|
194 | 199 | }, |
195 | 200 | { |
196 | 201 | "cell_type": "code", |
197 | | - "execution_count": null, |
| 202 | + "execution_count": 4, |
198 | 203 | "metadata": { |
199 | 204 | "colab": { |
200 | 205 | "base_uri": "https://localhost:8080/" |
|
206 | 211 | { |
207 | 212 | "data": { |
208 | 213 | "text/plain": [ |
209 | | - "[\"I'd hump to go to Japan but the slate are 500 dollars\",\n", |
210 | | - " \"I'd love to go to Nippon but the tickets are 500 buck\",\n", |
211 | | - " \"I'd love to go to japan but the tickets are 500 dollar\",\n", |
212 | | - " \"I'd love to perish to Japan but the fine are 500 dollars\",\n", |
213 | | - " \"I'd love to start to Japan but the tickets are 500 buck\"]" |
| 214 | + "[\"I'd fuck to fit to Japan but the tickets are 500 dollars\",\n", |
| 215 | + " \"I'd know to cristal to Japan but the tickets are 500 dollars\",\n", |
| 216 | + " \"I'd love to depart to Japan but the tickets are D dollars\",\n", |
| 217 | + " \"I'd love to get to Nihon but the tickets are 500 dollars\",\n", |
| 218 | + " \"I'd love to work to Japan but the tickets are 500 buck\"]" |
214 | 219 | ] |
215 | 220 | }, |
216 | | - "execution_count": 7, |
217 | | - "metadata": { |
218 | | - "tags": [] |
219 | | - }, |
| 221 | + "execution_count": 4, |
| 222 | + "metadata": {}, |
220 | 223 | "output_type": "execute_result" |
221 | 224 | } |
222 | 225 | ], |
|
230 | 233 | { |
231 | 234 | "cell_type": "markdown", |
232 | 235 | "metadata": { |
233 | | - "collapsed": true, |
234 | 236 | "id": "whvwbHLVEJ-S" |
235 | 237 | }, |
236 | 238 | "source": [ |
|
259 | 261 | "name": "python", |
260 | 262 | "nbconvert_exporter": "python", |
261 | 263 | "pygments_lexer": "ipython3", |
262 | | - "version": "3.7.7" |
| 264 | + "version": "3.8.8" |
263 | 265 | } |
264 | 266 | }, |
265 | 267 | "nbformat": 4, |
266 | | - "nbformat_minor": 1 |
| 268 | + "nbformat_minor": 4 |
267 | 269 | } |
0 commit comments