We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b81eeed + 330c530 commit a8af50dCopy full SHA for a8af50d
chapter5/Chapter 5.ipynb
@@ -7,6 +7,21 @@
7
"# Chapter 5: Text Classification"
8
]
9
},
10
+ {
11
+ "cell_type": "code",
12
+ "execution_count": null,
13
+ "outputs": [],
14
+ "source": [
15
+ "!pip install torchtext~=0.7.0\n",
16
+ "!pip install torch~=1.6"
17
+ ],
18
+ "metadata": {
19
+ "collapsed": false,
20
+ "pycharm": {
21
+ "name": "#%%\n"
22
+ }
23
24
+ },
25
{
26
"cell_type": "code",
27
"execution_count": 37,
@@ -309,6 +324,7 @@
309
324
" categories = {0: \"Negative\", 1:\"Positive\"}\n",
310
325
" processed = TWEET.process([TWEET.preprocess(tweet)])\n",
311
326
" processed = processed.to(device)\n",
327
+ " model.eval()\n",
312
328
" return categories[model(processed).argmax().item()]"
313
329
314
330
0 commit comments