{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# IMDB" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%reload_ext autoreload\n", "%autoreload 2\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from fastai import *\n", "from fastai.text import *" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Preparing the data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First let's download the dataset we are going to study. The [dataset](http://ai.stanford.edu/~amaas/data/sentiment/) has been curated by Andrew Maas et al. and contains a total of 100,000 reviews on IMDB. 25,000 of them are labelled as positive and negative for training, another 25,000 are labelled for testing (in both cases they are highly polarized). The remaning 50,000 is an additional unlabelled data (but we will find a use for it nonetheless).\n", "\n", "We'll begin with a sample we've prepared for you, so that things run quickly before going over the full dataset." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[PosixPath('/home/jhoward/.fastai/data/imdb_sample/texts.csv'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb_sample/models')]" ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "path = untar_data(URLs.IMDB_SAMPLE)\n", "path.ls()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It only contains one csv file, let's have a look at it." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
labeltextis_valid
0negativeUn-bleeping-believable! Meg Ryan doesn't even ...False
1positiveThis is a extremely well-made film. The acting...False
2negativeEvery once in a long while a movie will come a...False
3positiveName just says it all. I watched this movie wi...False
4negativeThis movie succeeds at being one of the most u...False
\n", "
" ], "text/plain": [ " label text is_valid\n", "0 negative Un-bleeping-believable! Meg Ryan doesn't even ... False\n", "1 positive This is a extremely well-made film. The acting... False\n", "2 negative Every once in a long while a movie will come a... False\n", "3 positive Name just says it all. I watched this movie wi... False\n", "4 negative This movie succeeds at being one of the most u... False" ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = pd.read_csv(path/'texts.csv')\n", "df.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'This is a extremely well-made film. The acting, script and camera-work are all first-rate. The music is good, too, though it is mostly early in the film, when things are still relatively cheery. There are no really superstars in the cast, though several faces will be familiar. The entire cast does an excellent job with the script.

But it is hard to watch, because there is no good end to a situation like the one presented. It is now fashionable to blame the British for setting Hindus and Muslims against each other, and then cruelly separating them into two countries. There is some merit in this view, but it\\'s also true that no one forced Hindus and Muslims in the region to mistreat each other as they did around the time of partition. It seems more likely that the British simply saw the tensions between the religions and were clever enough to exploit them to their own ends.

The result is that there is much cruelty and inhumanity in the situation and this is very unpleasant to remember and to see on the screen. But it is never painted as a black-and-white case. There is baseness and nobility on both sides, and also the hope for change in the younger generation.

There is redemption of a sort, in the end, when Puro has to make a hard choice between a man who has ruined her life, but also truly loved her, and her family which has disowned her, then later come looking for her. But by that point, she has no option that is without great pain for her.

This film carries the message that both Muslims and Hindus have their grave faults, and also that both can be dignified and caring people. The reality of partition makes that realisation all the more wrenching, since there can never be real reconciliation across the India/Pakistan border. In that sense, it is similar to \"Mr & Mrs Iyer\".

In the end, we were glad to have seen the film, even though the resolution was heartbreaking. If the UK and US could deal with their own histories of racism with this kind of frankness, they would certainly be better off.'" ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['text'][1]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It contains one line per review, with the label ('negative' or 'positive'), the text and a flag to determine if it should be part of the validation set or the training set. If we ignore this flag, we can create a DataBunch containing this data in one line of code:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "data_lm = TextDataBunch.from_csv(path, 'texts.csv')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By executing this line a process was launched that took a bit of time. Let's dig a bit into it. Images could be fed (almost) directly into a model because they're just a big array of pixel values that are floats between 0 and 1. A text is composed of words, and we can't apply mathematical functions to them directly. We first have to convert them to numbers. This is done in two differents steps: tokenization and numericalization. A `TextDataBunch` does all of that behind the scenes for you.\n", "\n", "Before we delve into the explanations, let's take the time to save the things that were calculated." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "data_lm.save()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Next time we launch this notebook, we can skip the cell above that took a bit of time (and that will take a lot more when you get to the full dataset) and load those results like this:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "data = TextDataBunch.load(path)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Tokenization" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The first step of processing we make texts go through is to split the raw sentences into words, or more exactly tokens. The easiest way to do this would be to split the string on spaces, but we can be smarter:\n", "\n", "- we need to take care of punctuation\n", "- some words are contractions of two different words, like isn't or don't\n", "- we may need to clean some parts of our texts, if there's HTML code for instance\n", "\n", "To see what the tokenizer had done behind the scenes, let's have a look at a few texts in a batch." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
textlabel
xxbos xxfld 1 raising victor vargas : a review \\n\\n you know , raising victor vargas is like sticking your hands into a big , xxunk bowl of xxunk . it 's warm and gooey , but you 're not sure if it feels right . try as i mightnegative
xxbos xxfld 1 now that che(2008 ) has finished its relatively short australian cinema run ( extremely limited xxunk screen in xxunk , after xxunk ) , i can xxunk join both xxunk of \" at the movies \" in taking steven soderbergh to task . \\n\\n it 's usuallynegative
xxbos xxfld 1 many xxunk that this is n't just a classic due to the fact that it 's the first xxup 3d game , or even the first xxunk - up . it 's also one of the first xxunk games , one of the xxunk definitely the firstpositive
xxbos xxfld 1 i really wanted to love this show . i truly , honestly did . \\n\\n for the first time , gay viewers get their own version of the \" the bachelor \" . with the help of his obligatory \" hag \" xxunk , james , anegative
xxbos xxfld 1 this film sat on my xxunk for weeks before i watched it . i xxunk a self - indulgent xxunk flick about relationships gone bad . i was wrong ; this was an xxunk xxunk into the xxunk - up xxunk of new xxunk . \\n\\n thepositive
\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "data = TextClasDataBunch.load(path)\n", "data.show_batch()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The texts are truncated at 100 tokens for more readability. We can see that it did more than just split on space and punctuation symbols: \n", "- the \"'s\" are grouped together in one token\n", "- the contractions are separated like his: \"did\", \"n't\"\n", "- content has been cleaned for any HTML symbol and lower cased\n", "- there are several special tokens (all those that begin by xx), to replace unkown tokens (see below) or to introduce different text fields (here we only have one)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Numericalization" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Once we have extracted tokens from our texts, we convert to integers by creating a list of all the words used. We only keep the ones that appear at list twice with a maximum vocabulary size of 60,000 (by default) and replace the ones that don't make the cut by the unknown token `UNK`.\n", "\n", "The correspondance from ids tokens is stored in the `vocab` attribute of our datasets, in a dictionary called `itos` (for int to string)." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['xxunk', 'xxpad', 'the', ',', '.', 'and', 'a', 'of', 'to', 'is']" ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data.vocab.itos[:10]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And if we look at what a what's in our datasets, we'll see the tokenized text as a representation:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Text xxbos xxfld 1 he now has a name , an identity , some memories and a a lost girlfriend . all he wanted was to disappear , but still , they xxunk him and destroyed the world he hardly built . now he wants some explanation , and to get ride of the people how made him what he is . yeah , jason bourne is back , and this time , he 's here with a vengeance . \n", "\n", " xxup ok , this movie does n't have the most xxunk script in the world , but its thematics are very clever and ask some serious questions about our society . of course , like every xxunk movie since the end of the 90 's , \" the bourne xxunk \" is a super - heroes story . jason bourne is a captain - america project - like , who 's gone completely wrong . in the first movie , the hero discovered his abilities and he accepted them in the second one . he now fights against what he considers like evil , after a person close to him has been killed ( his girlfriend in \" xxunk \" ) by them . that 's all a part of the super - hero story , including a character with ( realistic but still impressive : he almost invincible ) super powers . \n", "\n", " and the interesting point is that the evil he fights all across the world ( there 's no xxunk in the bourne 's movies , characters are going from one continent to another in the xxunk of an eye ) , is , as in the best seasons of \" 24 \" , an american enemy , who 's beliefs that he fight for the good of his country completely xxunk him . funny how \" mad patriots \" are now the xxup xxunk enemies of xxunk hollywood 's stories . \n", "\n", " xxunk all those interesting thematics , the movie is n't flawless : the feminine character of xxunk xxunk is for now on completely useless and the direction is quite xxunk when it comes to dialogs scenes . but all that does n't really matter , for \" the bourne ultimatum \" is an action movie . and the action scenes are rather impressive . \n", "\n", " everyone here is talking about the \" xxunk scene \" and the \" xxunk xxunk \" and everyone 's right . i particularly enjoyed the fight in xxunk , that reminds my in its exaggeration and xxunk the works of xxunk xxunk . visually inventive scenes , lots of intelligent action parts and a good reflection on american 's contemporary thematics : \" the bourne ultimatum \" is definitely the best movie of the series and a very interesting and original action flick ." ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data.train_ds[0][0]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "But the underlying data is all numbers" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([ 43, 44, 40, 34, 171, 62, 6, 352, 3, 47])" ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data.train_ds[0][0].data[:10]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### With the data block API" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can use the data block API with NLP and have a lot more flexibility than what the default factory methods offer. In the previous example for instance, the data was randomly split between train and validation instead of reading the third column of the csv.\n", "\n", "With the data block API though, we have to manually call the tokenize and numericalize steps. This allows more flexibility, and if you're not using the defaults from fastai, the variaous arguments to pass will appear in the step they're revelant, so it'll be more readable." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "data = (TextList.from_csv(path, 'texts.csv', cols='text')\n", " .split_from_df(col=2)\n", " .label_from_df(cols=0)\n", " .databunch())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now let's grab the full dataset for what follows." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[PosixPath('/home/jhoward/.fastai/data/imdb/imdb.vocab'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/models'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/tmp_lm'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/train'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/test'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/README'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/tmp_clas')]" ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "path = untar_data(URLs.IMDB)\n", "path.ls()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[PosixPath('/home/jhoward/.fastai/data/imdb/train/pos'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/train/unsup'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/train/unsupBow.feat'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/train/labeledBow.feat'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/train/neg')]" ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(path/'train').ls()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The reviews are in a training and test set following an imagenet structure. The only difference is that there is an `unsup` folder in `train` that contains the unlabelled data." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Language model" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We're not going to train a model that classifies the reviews from scratch. Like in computer vision, we'll use a model pretrained on a bigger dataset (a cleaned subset of wikipeia called [wikitext-103](https://einstein.ai/research/blog/the-wikitext-long-term-dependency-language-modeling-dataset)). That model has been trained to guess what the next word, its input being all the previous words. It has a recurrent structure and a hidden state that is updated each time it sees a new word. This hidden state thus contains information about the sentence up to that point.\n", "\n", "We are going to use that 'knowledge' of the English language to build our classifier, but first, like for computer vision, we need to fine-tune the pretrained model to our particular dataset. Because the English of the reviex lefts by people on IMDB isn't the same as the English of wikipedia, we'll need to adjust a little bit the parameters of our model. Plus there might be some words extremely common in that dataset that were barely present in wikipedia, and therefore might no be part of the vocabulary the model was trained on.\n", "\n", "Note that language models can use a lot of GPU, so you may need to decrease batchsize here." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "bs=48" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This is where the unlabelled data is going to be useful to us, as we can use it to fine-tune our model. Let's create our data object with the data block API (next line takes a few minutes)." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "data_lm = (TextList.from_folder(path)\n", " #Inputs: all the text files in path\n", " .filter_by_folder(include=['train', 'test']) \n", " #We may have other temp folders that contain text files so we only keep what's in train and test\n", " .random_split_by_pct(0.1)\n", " #We randomly split and keep 10% (10,000 reviews) for validation\n", " .label_for_lm() \n", " #We want to do a language model so we label accordingly\n", " .databunch(bs=bs))\n", "data_lm.save('tmp_lm')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We have to use a special kind of `TextDataBunch` for the language model, that ignores the labels (that's why we put 0 everywhere), will shuffle the texts at each epoch before concatenating them all together (only for training, we don't shuffle for the validation set) and will send batches that read that text in order with targets that are the next word in the sentence.\n", "\n", "The line before being a bit long, we want to load quickly the final ids by using the following cell." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "data_lm = TextLMDataBunch.load(path, 'tmp_lm', bs=bs)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idxtext
0xxbos after seeing the truman show , i wanted to see the other films by weir . i would say this is a good one to start with . the plot : \\n\\n the wife of a doctor ( who is trying to impress his bosses , so he can get xxunk trying to finish her written course , while he s at work . but one day a strange man , who says that he s a plumber , tells her he s been called out to repair some pipes in there flat .
1and turn to the wisdom of homeless people & ghosts . that 's a good plan . i would never recommend this movie ; partly because the sexual content is unnecessarily graphic , but also because it really does n't offer any valuable insight . check out \" yentl \" if you want to see a much more useful treatment of jewish tradition at odds with society . xxbos creep is the story of kate ( potente ) , an intensely unlikeable bourgeois bitch that finds herself somehow sleeping through the noise of the last
2been done before but there is something about the way its done here that lifts it up from the rest of the pack . \\n\\n 8 out of 10 for dinosaur / monster lovers . xxbos i rented this movie to see how the sony xxunk camera shoots , ( i recently purchased the same camera ) and was blown away by the story and the acting . the directing , acting , editing was all above what i expected from what appeared at first glance to be a \" low budget \" type of
3troubles . nigel and xxunk are the perfect team , i 'd watch their show any day ! i was so crushed when they removed it , and anytime they had it on xxup tv after that i was over the moon ! they put it on on demand one summer ( only the first eight episodes or so ) and i 'd spend whole afternoons watching them one after the other ... but the worst part ? it is now back on a channel called xxunk - and xxup it xxup 's xxup on
4movie ! ) the movie is about edward , a obsessive - compulsive , nice guy , who happens to be a film editor . he is then lent to another department in the building , and he is sent to the posh yet violent world of sam campbell , the splatter and gore department . sam campbell , eddy 's new boss , is telling eddy about the big break on his movies , the gruesome loose limbs series , and he needs eddy to make the movie somewhat less violent so they can
5incredible action ( especially the finale featuring an excellent dragon ) and a generally brilliant cast . beowulf throws down the gauntlet to film - makers to show what can be done with xxup 3d and is an indication of the potential . it 's not all the way there yet , but it 's a damn good start . xxbos freeman gives his most powerful performance here . i 've seen almost all of morgan 's films but i think this is his most outstanding performance . fast black is one juicy character and
6his terms . a better title for the film would be \" it came from the planet of plot contrivances . \" the plot is excessively silly and nearly nonexistent . the humans are all given magical macguffins that conform to a tortuous series of unlikely restrictions just to move the bare plot . any thought to the passage of time is ignored . now it 's a couple days after meeting the alien , then xxup bam ! all of a sudden there 's only a couple hours left until zero hour . do
7do n't know who 's the hero or who 's the villian because everyone is so stupid that no one even cares . there is only one scene in this movie that 's good , where the nerd is trying to impress a girl and gets onto his motor powered trashy bike and crashed into a wall ! the nerd does try to be funny at times ( in a freddy krueger type of way ) but notice i say \" try \" . the music is tasteless , and so is the script .
8, to talk or to make lots of thing ! my conclusion is that this movie is not funny in a good way , but in a really stupid way ! xxbos just saw coronado ... around here the only line they came up with to sell it is \" from the xxup fx team behind independence day \" . i think that says a great deal . no talk about writers , directors , actors ... \\n\\n it 's a cute little adventure story set in a banana republic in mid america , but
9xxup of xxup the xxup brave tackles the 18th century struggle for the control of quebec ( an all of canada ) between the british and the french with sidebars form the new america . it has the makings of a sweeping epic of fascination , but sadly in the hands of writer pierre xxunk ( whose script deserves a razzie award for worst of the season ) and the scattered , unfocused , and confusing direction by jean xxunk this film is a dud - a two and a quarter hour tedious mess of
\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "data_lm.show_batch()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can then put this in a learner object very easily with a model loaded with the pretrained weights. They'll be downloaded the first time you'll execute the following line and stored in './fastai/models/' (or elsewhere if you specified different paths in your config file)." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "learn = language_model_learner(data_lm, pretrained_model=URLs.WT103, drop_mult=0.3)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "LR Finder is complete, type {learner_name}.recorder.plot() to see the graph.\n" ] } ], "source": [ "learn.lr_find()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZgAAAEKCAYAAAAvlUMdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAIABJREFUeJzt3Xd8VfX9+PHXO4tsZhL2CBuRGRmiKA7cItU66qiT0lKrtfq1rf3V3WrtsrUWcdW9xYo4cEIRGWFPQcIOJIEEErLH+/fHPcEYb0iAe3LuvXk/H4/7yLnnfM497w8JeedzPufz+YiqYowxxgRahNcBGGOMCU+WYIwxxrjCEowxxhhXWIIxxhjjCkswxhhjXGEJxhhjjCsswRhjjHGFJRhjjDGusARjjDHGFVFeBxBIHTp00J49e3odhjHGhIylS5fuVdUUNz47rBJMz549yczM9DoMY4wJGSKyza3PtltkxhhjXOFqghGRrSKyWkRWiMj3mhYiMklEVtUeF5GT6hz7k4isFZH1IvIPERE3YzXGGBNYzXGLbIKq7m3g2KfAu6qqIjIEeB0YICInAuOAIU65+cApwBduB2uMMSYwPO2DUdWDdd4mALVrBygQC8QAAkQDOc0bnTHGmGPhdh+MAnNEZKmITPFXQEQmi8gGYDZwPYCqfgV8Dux2Xh+p6voGzp/i3F7LzMvLc6USxhhjjpzbCWacqo4AzgGmicj4+gVUdaaqDgAuAu4HEJE+wECgK9AFOM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i5UkQWikias7+3836JiNzXxFbWV3w7aWeiiHwqIsvEtz7HJKfMQ0Bvp9XziFP2Duc6q0Tk3gD+MxrTKEswpiV6FPibqp4AXAw85ezfAIxX1eH4Zif+Q51zxgI/VtXTnPfDgVuBQUA6MM7PdRKAhao6FJgH3FTn+o861290PidnHqzT8c2mAFAGTFbVEfjWH/qLk+B+DWxW1WGqeoeITAT6AqOAYcBIERnf2PWMCRSb7NK0RGcAg+rMNJssIklAa+A5EemLb6bY6DrnfKyqddfcWKyqOwFEZAW+uaDm17tOBd9OELoUONPZHsu3a2m8DPy5gTjj6nz2Unxrc4BvLqg/OMmiBl/LJs3P+ROd13LnfSK+hDOvgesZE1CWYExLFAGMVdXSujtF5J/A56o62enP+KLO4eJ6n1FeZ7sa//+XKvXbTs6GyhxOqaoOE5HW+BLVNOAf+NZ/SQFGqmqliGwFYv2cL8AfVfWJI7yuMQFht8hMSzQH3/opAIhI7bTmrYFdzva1Ll5/Ib5bcwCXN1ZYVQ/gWxb5dhGJxhdnrpNcJgA9nKJFQFKdUz8CrnfWB0FEuohIaoDqYEyjLMGYcBcvIjvrvG7D98s6w+n4XodviQWAPwF/FJEvgUgXY7oVuE1EFgOdgAONnaCqy/HNjHs5vgW5MkQkE19rZoNTZh/wpfNY8yOqOgffLbivRGQ18CbfTUDGuMoeUzammTmra5aqqorI5cAVqjqpsfOMCTXWB2NM8xsJPOY8+bUfj5ahNsZt1oIxxhjjCuuDMcYY4wpLMMYYY1xhCcYYY4wrLMEYY4xxhSUYY4wxrrAEY4wxxhX/H8X2hWA9MP90AAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "learn.recorder.plot(skip_end=15)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total time: 12:42\n", "epoch train_loss valid_loss accuracy\n", "1 4.591534 4.429290 0.251909 (12:42)\n", "\n" ] } ], "source": [ "learn.fit_one_cycle(1, 1e-2, moms=(0.8,0.7))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "learn.save('fit_head')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "learn.load('fit_head');" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To complete the fine-tuning, we can then unfeeze and launch a new training." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total time: 2:22:17\n", "epoch train_loss valid_loss accuracy\n", "1 4.307920 4.245430 0.271067 (14:14)\n", "2 4.253745 4.162714 0.281017 (14:13)\n", "3 4.166390 4.114120 0.287092 (14:14)\n", "4 4.099329 4.068735 0.292060 (14:10)\n", "5 4.048801 4.035339 0.295645 (14:12)\n", "6 3.980410 4.009860 0.298551 (14:12)\n", "7 3.947437 3.991286 0.300850 (14:14)\n", "8 3.897383 3.977569 0.302463 (14:15)\n", "9 3.866736 3.972447 0.303147 (14:14)\n", "10 3.847952 3.972852 0.303105 (14:15)\n", "\n" ] } ], "source": [ "learn.unfreeze()\n", "learn.fit_one_cycle(10, 1e-3, moms=(0.8,0.7))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "learn.save('fine_tuned')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "How good is our model? Well let's try to see what it predicts after a few given words." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "learn.load('fine_tuned');" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total time: 00:10\n", "\n" ] }, { "data": { "text/plain": [ "'I liked this movie because of course after yeah funny later that the world reason settings - the movie that perfect the kill of the same plot - a mention of the most of course . do xxup diamonds and the \" xxup disappeared kill of course and the movie niece , from the care more the story of the let character , \" i was a lot \\'s the little performance is not only . the excellent for the most of course , with the minutes night on the into movies ( ! , in the movie its the first ever ! \\n\\n a'" ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "learn.predict('I liked this movie because ', 100, temperature=1.1, min_p=0.001)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We have to save the model but also it's encoder, the part that's responsible for creating and updating the hidden state. For the next part, we don't care about the part that tries to guess the next word." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "learn.save_encoder('fine_tuned_enc')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Classifier" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now, we'll create a new data object that only grabs the labelled data and keeps those labels. Again, this line takes a bit of time." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[PosixPath('/home/jhoward/.fastai/data/imdb/imdb.vocab'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/models'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/tmp_lm'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/train'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/test'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/README'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/tmp_clas')]" ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "path = untar_data(URLs.IMDB)\n", "path.ls()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[PosixPath('/home/jhoward/.fastai/data/imdb/train/pos'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/train/unsup'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/train/unsupBow.feat'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/train/labeledBow.feat'),\n", " PosixPath('/home/jhoward/.fastai/data/imdb/train/neg')]" ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(path/'train').ls()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "data_clas = (TextList.from_folder(path, vocab=data_lm.vocab)\n", " #grab all the text files in path\n", " .split_by_folder(valid='test')\n", " #split by train and valid folder (that only keeps 'train' and 'test' so no need to filter)\n", " .label_from_folder(classes=['neg', 'pos'])\n", " #remove docs with labels not in above list (i.e. 'unsup')\n", " .filter_missing_y()\n", " #label them all with their folders\n", " .databunch(bs=bs))\n", "data_clas.save('tmp_clas')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "75000" ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(data_clas.train_ds)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
textlabel
xxfld 1 match 1 : tag team table match bubba ray and spike dudley vs eddie guerrero and chris benoit bubba ray and spike dudley started things off with a tag team table match against eddie guerrero and chris benoit . according to the rules of the match , bothpos
xxfld 1 i have never seen any of spike lee 's prior films , as their trailers never caught my interest . i have seen , and admire denzel washington , and jodie foster 's work , and have several of their dvds . i was , however , entirelyneg
xxfld 1 pier paolo pasolini , or pee - pee - pee as i prefer to call him ( due to his love of showing male genitals ) , is perhaps xxup the most overrated european marxist director - and they are thick on the ground . how anyone canneg
xxfld 1 chris rock deserves better than he gives himself in \" down to earth . \" as directed by brothers chris & paul weitz of \" american pie \" fame , this uninspired remake of warren beatty 's 1978 fantasy \" heaven can wait , \" itself a rehashneg
xxfld 1 yesterday , i went to the monthly antique flea market that comes to town . i really have no interest in such things , but i went for the fellowship of friends who do have such an interest . looking over the hundreds of vendor , passing manypos
\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "data_clas = TextClasDataBunch.load(path, 'tmp_clas', bs=bs)\n", "data_clas.show_batch()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can then create a model to classify those reviews and load the encoder we saved before." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "learn = text_classifier_learner(data_clas, drop_mult=0.5)\n", "learn.load_encoder('fine_tuned_enc')\n", "learn.freeze()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "LR Finder is complete, type {learner_name}.recorder.plot() to see the graph.\n" ] } ], "source": [ "learn.lr_find()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAIABJREFUeJzt3Xl8VOXVwPHfyU6AQIAQMGEnLGHHsEkVQUG0VURbhbrbim3VVq3tq621Fmut+rZWq12w2taVF3dUFBdQBEEJ+w5hDwESlpAEsue8f8wNDiHJBJg7S3K+n898mHvnuXPPJZk5eZb7PKKqGGOMMfWJCHYAxhhjQp8lC2OMMT5ZsjDGGOOTJQtjjDE+WbIwxhjjkyULY4wxPlmyMMYY45MlC2OMMT5ZsjDGGONTVLAD8Jd27dpp165dgx2GMcaElWXLlh1Q1SRf5RpNsujatSuZmZnBDsMYY8KKiOxsSDlrhjLGGOOTJQtjjDE+WbIwxhjjkyULY4wxPrmaLERkoohsEpEsEbm3ltc7i8h8EVkhIqtF5BJn/3gRWSYia5x/x7kZpzHGmPq5NhpKRCKBZ4DxQDawVERmq+p6r2L3A7NU9e8ikg7MAboCB4BLVTVHRPoDc4EUt2I1xhhTPzdrFsOBLFXdpqplwExgUo0yCiQ4z1sBOQCqukJVc5z964A4EYl1MVZjjDH1cPM+ixRgt9d2NjCiRpkHgY9E5A6gOXBhLe9zJbBCVU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SmeWWfXisi7vmZuFZHWIvITf5zbmJps6Kxp1ESkSFVb+PH9ovSbCfJc5R27iPwX2KyqD9dTvivwnqr2D0R8pmmxmoVpckQkSUTeEJGlzmO0s3+4iHwpIiucf3s7+28UkddE5F3gIxE5X0Q+E5HXxbNmw8vVawM4+zOc50XOZICrRGSJiCQ7+3s420tFZHoDaz+L+WaixBYi8qmILBfP+gSTnDJ/BHo4tZHHnbK/cM6zWkR+58f/RtPEWLIwTdGTwBOqOgy4EviXs38jcJ6qDsEzy+sfvI4ZBdygquOc7SHAnUA60B0YXct5mgNLVHUQsAC4xev8Tzrn9zk/jzOf0QV47qgHKAEmq+pQPGuo/MlJVvcCW1V1sKr+QkQmAGnAcGAwcLaInOfrfMbUxiYSNE3RhUC614yeCSLSEmgF/FdE0vDMyBntdczHquq95sDXqpoNICIr8czts7DGecr4ZiLGZcB45/kovllL4BXgf+uIs5nXey/DszYBeOb2+YPzxV+Fp8aRXMvxE5zHCme7BZ7ksaCO8xlTJ0sWpimKAEaparH3ThH5KzBfVSc77f+feb18tMZ7lHo9r6T2z1K5ftMpWFeZ+hSr6mARaYUn6dwGPIVnfYsk4GxVLReRHUBcLccL8Iiq/vMUz2vMSawZyjRFH+FZHwIAEameCroVsMd5fqOL51+Cp/kLYIqvwqp6BM/SqveISDSeOHOdRDEW6OIULQRaeh06F7jZWR8BEUkRkfZ+ugbTxFiyMI1dvIhkez3uxvPFm+F0+q7HM7U8wGPAIyKyCIh0MaY7gbtF5GugI3DE1wGqugLPDKRT8CwklCEimXhqGRudMgeBRc5Q28dV9SM8zVyLRWQN8DonJhNjGsyGzhoTYM5qfsWqqiIyBZiqqpN8HWdMMFmfhTGBdzbwtDOCKZ8ALltrzOmymoUxxhifrM/CGGOMT5YsjDHG+GTJwhhjjE+WLIwxxvhkycIYY4xPliyMMcb49P8uvB9iwGuu0QAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "learn.recorder.plot()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total time: 02:46\n", "epoch train_loss valid_loss accuracy\n", "1 0.294225 0.210385 0.918960 (02:46)\n", "\n" ] } ], "source": [ "learn.fit_one_cycle(1, 2e-2, moms=(0.8,0.7))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "learn.save('first')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "learn.load('first');" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total time: 03:03\n", "epoch train_loss valid_loss accuracy\n", "1 0.268781 0.180993 0.930760 (03:03)\n", "\n" ] } ], "source": [ "learn.freeze_to(-2)\n", "learn.fit_one_cycle(1, slice(1e-2/(2.6**4),1e-2), moms=(0.8,0.7))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "learn.save('second')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "learn.load('second');" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total time: 04:06\n", "epoch train_loss valid_loss accuracy\n", "1 0.211133 0.161494 0.941280 (04:06)\n", "\n" ] } ], "source": [ "learn.freeze_to(-3)\n", "learn.fit_one_cycle(1, slice(5e-3/(2.6**4),5e-3), moms=(0.8,0.7))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "learn.save('third')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "learn.load('third');" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total time: 10:01\n", "epoch train_loss valid_loss accuracy\n", "1 0.188145 0.155038 0.942480 (05:00)\n", "2 0.159475 0.153531 0.944040 (05:01)\n", "\n" ] } ], "source": [ "learn.unfreeze()\n", "learn.fit_one_cycle(2, slice(1e-3/(2.6**4),1e-3), moms=(0.8,0.7))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "('pos', tensor(0), tensor([[9.9999e-01, 1.1991e-05]]))" ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "learn.predict(\"I really loved that movie, it was awesome!\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" } }, "nbformat": 4, "nbformat_minor": 2 }