diff --git a/Testing.ipynb b/Testing.ipynb index 31bfa07..e5d293d 100644 --- a/Testing.ipynb +++ b/Testing.ipynb @@ -2,14 +2,14 @@ "cells": [ { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "401 - Unauthorized\r\n" + "/bin/sh: kaggle: command not found\r\n" ] } ], @@ -19,7 +19,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -55,15 +55,14 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Archive: dialogue-lines-of-the-simpsons.zip\n", - " inflating: simpsons_dataset.csv \n" + "unzip: cannot find or open dialogue-lines-of-the-simpsons.zip, dialogue-lines-of-the-simpsons.zip.zip or dialogue-lines-of-the-simpsons.zip.ZIP.\r\n" ] } ], @@ -73,7 +72,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -82,7 +81,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -94,7 +93,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 6, "metadata": { "scrolled": true }, @@ -253,7 +252,7 @@ "21 Bart Simpson Well, don't sweat it. Just so long as a couple..." ] }, - "execution_count": 20, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -264,7 +263,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 7, "metadata": { "scrolled": true }, @@ -278,26 +277,24 @@ " 'That life is worth living.',\n", " \"The polls will be open from now until the end of recess. Now, just in case any of you have decided to put any thought into this, we'll have our final statements. Martin?\",\n", " \"I don't think there's anything left to say.\", 'Bart?',\n", - " 'Victory party under the slide!', nan,\n", - " 'Mr. Bergstrom! Mr. Bergstrom!',\n", + " 'Victory party under the slide!', 'Mr. Bergstrom! Mr. Bergstrom!',\n", " 'Hey, hey, he Moved out this morning. He must have a new job -- he took his Copernicus costume.',\n", " 'Do you know where I could find him?',\n", " \"I think he's taking the next train to Capital City.\",\n", " 'The train, how like him... traditional, yet environmentally sound.',\n", " \"Yes, and it's been the backbone of our country since Leland Stanford drove that golden spike at Promontory point.\",\n", - " 'I see he touched you, too.', nan,\n", - " 'Hey, thanks for your vote, man.',\n", + " 'I see he touched you, too.', 'Hey, thanks for your vote, man.',\n", " \"I didn't vote. Voting's for geeks.\",\n", " 'Well, you got that right. Thanks for your vote, girls.',\n", " 'We forgot.',\n", " \"Well, don't sweat it. Just so long as a couple of people did... right, Milhouse?\",\n", " 'Uh oh.', 'Lewis?', 'Somebody must have voted.',\n", - " \"What about you, Bart? Didn't you vote?\", 'Uh oh.', nan,\n", - " 'Yayyyyyyyyyyyyyy!', nan, 'I demand a recount.',\n", + " \"What about you, Bart? Didn't you vote?\", 'Uh oh.',\n", + " 'Yayyyyyyyyyyyyyy!', 'I demand a recount.',\n", " 'One for Martin, two for Martin. Would you like another recount?',\n", " 'No.',\n", " 'Well, I just want to make sure. One for Martin. Two for Martin.',\n", - " 'This way, Mister President!', nan,\n", + " 'This way, Mister President!',\n", " 'Now boarding on track 5, The afternoon delight coming to Shelbyville, Parkville, and…..',\n", " 'Mr. Bergstrom! Hey, Mr. Bergstrom!', 'Hey, Lisa.',\n", " 'Hey, Lisa, indeed.', 'What? What is it?',\n", @@ -314,7 +311,7 @@ " \"Whenever you feel like you're alone and there's nobody you can rely on, this is all you need to know.\",\n", " 'Thank you, Mr. Bergstrom.', 'All aboard!',\n", " \"So, I guess this is it? It you don't mind I'll just run alongside the train as it speeds you from my life?\",\n", - " \"Goodbye, Lisa honey. It'll be okay. Just read the note.\", nan,\n", + " \"Goodbye, Lisa honey. It'll be okay. Just read the note.\",\n", " 'Never thrown a party? What about that big bash we had with all the champagne and musicians and holy men and everything?',\n", " \"Bart didn't get one vote?! Oh, this is the worst thing that ever happened to us. Alright, allright, spilled milk, spilled milk, spilled milk. What are you so mopey about?\",\n", " 'Nothing.', 'Lisa, tell your father.', 'Mr. Bergstrom left today.',\n", @@ -333,7 +330,7 @@ " 'Look, if you just want me to forgive you --',\n", " 'No, no, no. I just wish I knew what to say.',\n", " \"Although, maybe this will help. Now you lost someone special and it hurts. I'm lucky because I never lost anyone special to me. Everyone special to me is under this roof.\",\n", - " nan, 'That was our wedding.', 'Oh.',\n", + " 'That was our wedding.', 'Oh.',\n", " \"Children, it's time for you to go to bed.\",\n", " \"It's true. Now, you'll have lots of special people in your life, Lisa. There's probably some place where they all get together, and the food is real good, and guys like me are serving drinks. Oh well, maybe I can't explain all this, but I can fix your doll house for you. At least, I'm good at monkey work. You know... monkey. You know what I mean?\",\n", " 'Yeah.', 'I can hold these nails in place with my tail.',\n", @@ -351,7 +348,7 @@ " 'Uh oh.', 'Sleep well, Maggie. Ah, three for three.',\n", " 'Homie, did you straighten everything out...?',\n", " \"Up... up... up... up... up... up. Don't say anything, Marge. Let's just go to bed. I'm on the biggest roll of my life.\",\n", - " nan, 'Mmm... hors doovers.', 'Homer! You promised!',\n", + " 'Mmm... hors doovers.', 'Homer! You promised!',\n", " \"I promised I wouldn't eat? Never! You lie!\",\n", " \"Homer, please. We've never thrown a party. Now we're gonna pay back all the friends who've invited us to their homes.\",\n", " 'But Mom, I want to hear the witty banter of sophisticated adults.',\n", @@ -370,7 +367,7 @@ " 'Au contraire, Simpson! It has three shots of rum, a jigger of bourbon and just little dab-a-roo of creme de cassis for flavor.',\n", " \"Really? Well I do have a warm sense of well-being and I seem to be ssslurring my shpeech... you're right! Give me another.\",\n", " \"Now, Homer, go easy on the al-ky-hol. Remember last year at the Winfield's party when you threw up in the laundry hamper?\",\n", - " 'No.', nan, nan, nan,\n", + " 'No.',\n", " \"Hi! You're Homer's sister-in-law, right? I remember you, but I don't remember you being so beau --tiful.\",\n", " 'Ow! Hey! Jeez!',\n", " \"Is that a new kind of Mace? It's really painful.\",\n", @@ -391,7 +388,7 @@ " 'You stink! You and your whole lousy operation stinks! I quit!',\n", " \"Uh, gee Homer, don't quit...\", 'All right then.',\n", " 'Could you... give me a handful of peanuts... Maude?', 'Oh sure.',\n", - " 'Not those peanuts. The ones at the bottom.', nan, nan,\n", + " 'Not those peanuts. The ones at the bottom.',\n", " \"Hey, thanks for invitin' me. I had a wonderful time.\",\n", " 'I must apologize for my husband.',\n", " 'If you want him to live through the night, I suggest you roll him onto his side.',\n", @@ -399,38 +396,37 @@ " 'Remember, I said if.',\n", " 'I have never been so embarrassed in my life.',\n", " \"Why? What'd you do?\", 'Marge!', 'Come here!',\n", - " 'Where-where are we going?', 'Shhh.', nan,\n", + " 'Where-where are we going?', 'Shhh.',\n", " \"I want to make sure the kids don't hear. When I was young, I always hated knowing my parents were fighting.\",\n", - " nan, \"They're fighting in the car again.\",\n", - " 'That music always sends a chill down my spine.', nan,\n", + " \"They're fighting in the car again.\",\n", + " 'That music always sends a chill down my spine.',\n", " 'Homer, do you remember the way you acted at the party last night?',\n", - " 'The way I acted?', nan,\n", + " 'The way I acted?',\n", " 'So I said: I must get out of these wet clothes and into a dry martini.',\n", " \"Good lord! There's a fly in my drink!\", 'I put it there.',\n", " 'You did?', 'I slipped it into your glass as a gag.',\n", " 'Pure hilarity!', 'Pure Homer!',\n", - " 'I pronounce it to be the most whimsical jape of the season!', nan,\n", + " 'I pronounce it to be the most whimsical jape of the season!',\n", " \"Homer, I like to think that I'm a patient, tolerant woman, and that there was no line you could cross that could make me stop loving you. But last night, you didn't just cross that line, you threw up on it!\",\n", " \"I'm sorry, honey. Can't we just forget it and go to church.\",\n", " \"I'm going to church alone today. You're going to stay here and explain to Bart why you scarred him for life.\",\n", - " \"No, I didn't... I... Oh, you mean inside, don't you?\", nan,\n", + " \"No, I didn't... I... Oh, you mean inside, don't you?\",\n", " \"About last night... you might have noticed Daddy acting a little strange and you probably don't understand why.\",\n", " 'I understand why. You were wasted.',\n", " \"I admit it. I didn't know when to say when. I'm sorry it happened and I just hope you didn't lose a lot of respect for me.\",\n", " 'Dad, I have as much respect for you as I ever did or ever will.',\n", - " 'Aw.', nan,\n", + " 'Aw.',\n", " 'Now before I give you all a sneak preview of next week\\'s sermon, I have some announcements to make. We have some new pamphlets available in our church newsrack including \"Bible Bafflers\", \"Satan\\'s Boners,\" \"Good Grief! More Satan\\'s Boners\" and, for the teens, \"It\\'s Not Cool To Fry In Hell.\"',\n", " 'Marge, Marge.',\n", " \"I'm sorry. The Lord and I can't compete with the squeaking of Homer Simpson's shoes. Why don't we just put everything on hold until he takes a seat?\",\n", " 'Sorry, Reverend.', 'Sit down, Homer.',\n", " \"Mrs. Lovejoy and myself will be holding our third annual marriage retreat next weekend at Catfish Lake. It's psychological counseling for couples whose marriages are hanging by a thread...\",\n", - " nan, '... or those just in need of a tune-up.', 'Hmmmm.',\n", + " '... or those just in need of a tune-up.', 'Hmmmm.',\n", " 'Now if you wish to participate, please sign up on your way out after the service is over.',\n", - " nan, 'Will the Simpsons be attending our little retreat?',\n", + " 'Will the Simpsons be attending our little retreat?',\n", " \"Oh, well, it's very tempting. Really a wonderful idea.\",\n", " 'Marge! What are you doing? Are you insane?!', \"We'll be there!\",\n", - " nan, nan, 'Marriage encounter weekend, here I come!',\n", - " 'Now you wanna go?',\n", + " 'Marriage encounter weekend, here I come!', 'Now you wanna go?',\n", " \"They're holding it at Catfish Lake. They couldn't call it Catfish Lake if it didn't have a catfish in it.\",\n", " \"We're going to this retreat to give our marriage a tune-up and that's all. No fishing.\",\n", " 'Oh, that must be the babysitter.', \"Hello. I'm Mrs. Simpson.\",\n", @@ -451,9 +447,9 @@ " 'Call this number if Grampa falls in the bathtub.',\n", " 'I heard that.',\n", " \"Grampa, Mom was in such a hurry, she forgot to give you this. It's a list of the things Lisa and I can and can't do.\",\n", - " \"Uh huh .. Uh-huh... You're allowed smoke cigars?\", nan,\n", - " 'Hmmm, bait.', nan, 'Whoa, better get some gas.',\n", - " \"Fill 'er up. I guess I'll go and stretch my legs.\", nan,\n", + " \"Uh huh .. Uh-huh... You're allowed smoke cigars?\", 'Hmmm, bait.',\n", + " 'Whoa, better get some gas.',\n", + " \"Fill 'er up. I guess I'll go and stretch my legs.\",\n", " 'Where ya headed?', 'Catfish Lake.',\n", " 'Oh, after General Sherman, are ya?',\n", " \"Wait, wait a minute... wait a minute. Who's General Sherman?\",\n", @@ -461,11 +457,11 @@ " '... they say he weighs upwards of five hundred pounds.',\n", " 'Whoa, who says that?', 'They do.', 'Oh.',\n", " \"Now, that there's the only known picture of the General. Can't see what he is, exactly. He's freakishly big, though.\",\n", - " 'Hmmmm. Gentlemen: I am going to catch General Sherman!', nan,\n", + " 'Hmmmm. Gentlemen: I am going to catch General Sherman!',\n", " \"After the supermarket, we'll go to the video store, grab a Krusty Burger and head for the arcade.\",\n", " \"Bart, Grampa's a kindly old man who trusts us. Are you sure it's right to take advantage of him?\",\n", " \"Lis, in these crazy, topsy-turvy times, who's to say what's right or wrong? But right now my gut's telling me... Bleed Gramps dry.\",\n", - " nan, nan, 'Ah, Mr. and Mrs. Simpson. Welcome!',\n", + " 'Ah, Mr. and Mrs. Simpson. Welcome!',\n", " \"Hello, Reverend. We're glad we could come. Oh, hello Helen.\",\n", " 'Hel-lo Marge!',\n", " 'Why, Homer Simpson! Here to give your marriage a little spit shine?',\n", @@ -503,46 +499,43 @@ " 'He forgets birthdays, anniversaries, holidays -- both religious and secular -- he chews with his mouth open, he gambles, he hangs out at a seedy bar with bums and lowlifes...',\n", " \"It's true. It's all true.\", \"Homer, don't interrupt.\", 'Sorry.',\n", " 'He blows his nose on the towels, and puts them back in the middle...',\n", - " 'I only did that a couple of times.', nan,\n", + " 'I only did that a couple of times.',\n", " 'Half a gallon of chocolate.', 'Check.',\n", " 'Half a gallon of chocolate brownie fudge.', 'Check.',\n", " 'Half a gallon of chocolate, chocolate, chocolate, chocolate chip.',\n", " 'Check.', 'Did your Mom really write that shopping list?',\n", " 'Grampa, what a question?', \"What's next, Lis?\",\n", " 'Sprinkles and syrup.', 'Hey, Grampa. Aisle six and step on it.',\n", - " 'Well, all right, but put out that cigar.', nan,\n", + " 'Well, all right, but put out that cigar.',\n", " \"... He drinks out of the carton. He never changes the baby. When he goes to sleep, he makes chewing noises and when he wakes up he makes honking noises. Oh... oh... and he scratches himself with his keys. I guess that's it. Oh no. Wait. He kicks me in his sleep and his toenails are too long and yellow. That's all I can think of right now. I guess you're all tired and I want to thank you for letting me get some things off my chest.\",\n", - " \"Well, we've missed the luau. What say we call it a night?\", nan,\n", + " \"Well, we've missed the luau. What say we call it a night?\",\n", " \"I don't want to hear it, McBain. That cannon of yours is against regulations. In this department we go by the book.\",\n", " \"You know, kids, it's gettin' pretty late.\",\n", " \"Yeah, you should go to bed, Grampa. We've had a big day.\",\n", - " \"It's no use kidding myself. I'm having an ethical crisis.\", nan,\n", + " \"It's no use kidding myself. I'm having an ethical crisis.\",\n", " 'Out at five, catch General Sherman at five-thirty, clean him at six, eat him at six-thirty, back in bed by seven with no incriminating evidence. . The perfect crime.',\n", " \"Homer, you're sneaking out to go fishing? I can't believe your selfishness. You can go fishing anytime, but we're here trying to save our marriage. You're thinking about fishing, even when I'm talking... right now. Right?\",\n", " 'Would this be a good time to be honest?', 'Yes.',\n", " \"You're right, I am. Help me, Marge. What do I do to be a good guy?\",\n", " 'Get back in bed.', 'No.',\n", - " \"All right. But I can't sleep. Can I take a walk?\", 'Sure.', nan,\n", + " \"All right. But I can't sleep. Can I take a walk?\", 'Sure.',\n", " 'Gotta be a good husband... Gotta be a good husband... Gotta be a good husband.',\n", - " 'Hey, kid! You forgot your... WHOA!', nan,\n", + " 'Hey, kid! You forgot your... WHOA!',\n", " 'Go ahead, General Sherman! Waste your strength, you big ugly catfish. I gotta skillet and a stick of butter with your name on it.',\n", - " nan, 'Homer?', nan, 'Sugar?', 'Yes. Ten please.',\n", - " 'Hey Grampa, top me off.',\n", + " 'Homer?', 'Sugar?', 'Yes. Ten please.', 'Hey Grampa, top me off.',\n", " 'Are you sure your ma lets you kids drink coffee?',\n", - " 'For the last time, yes!', nan, 'Good! Give up!', 'Huh?', nan, nan,\n", + " 'For the last time, yes!', 'Good! Give up!', 'Huh?',\n", " 'Hey, Milhouse. Big blowout at Casa de Simpson. The only adult is frail and old.',\n", - " nan, \"Bart's joint. Uh, twoish. Be there or be square.\", nan,\n", + " \"Bart's joint. Uh, twoish. Be there or be square.\",\n", " \"Tell my friends? All right, but I've got some pretty funky friends.\",\n", - " nan,\n", " \"All right! I get out at noon and I'm already invited to a party.\",\n", - " nan,\n", " 'Now, this is a trust exercise. You fall backwards and rely on your spouse to catch you.',\n", " 'Do I have to do this?',\n", " \"No. Even if your husband were here, I wouldn't recommend it. Marge, as a trained marriage counselor, this is the first instance where I've ever told one partner that they were 100 percent right. It's all his fault, and I'm willing to put that in a certificate you can frame.\",\n", - " nan, 'Over there / Send the word / Send the word / Over there.',\n", - " \"That the Yanks are comin'...\", nan,\n", + " 'Over there / Send the word / Send the word / Over there.',\n", + " \"That the Yanks are comin'...\",\n", " \"Okay, fish, you're probably wondering why I'm still here. Catching you will make me the most famous fisherman there is, right up there with... that... the a... bald guy on that cable fishing show.\",\n", - " 'Whoa! Holy mackerel!', nan,\n", + " 'Whoa! Holy mackerel!',\n", " \"Milhouse, good to see you, pal. What's happening, man?\",\n", " 'Cherry party, Bart. Any chicks over eight?',\n", " 'Not yet, but the afternoon is young.', \"Lisa, what's wrong?\",\n", @@ -551,8 +544,8 @@ " 'Hey you, no, shut that door! Stop it! Put that away! No, stop, oh!',\n", " 'OW!', 'Haw haw haw!',\n", " 'You young hellion, do you want me to take off my belt?', 'Yeah.',\n", - " \"All right. I'll show you.\", 'Haw! Haw! Haw!', 'Doggone it!', nan,\n", - " 'I love you, but I must kill you.', nan,\n", + " \"All right. I'll show you.\", 'Haw! Haw! Haw!', 'Doggone it!',\n", + " 'I love you, but I must kill you.',\n", " 'Yeah, take care, man. Hey, thanks for coming. Hey, nice tie, Nelson..',\n", " \"Ah, thanks, it's your dad's.\",\n", " \"I tried to be a good baby-sitter, but I failed! I'm a feeb... a useless old... worn-out...\",\n", @@ -560,7 +553,6 @@ " \"It's called remorse, you vile burlesque of irrepressible youth.\",\n", " 'Well, how do you make this feeling go away?',\n", " 'You grab a bucket and a brush and clean harder and faster than you ever have before.',\n", - " nan,\n", " 'I AM THE CHAMPIONS / I AM THE CHAMPIONS / NO TIME FOR LOSERS / CAUSE I AM THE CHAMPIONS / OF THE WORLLLLD!',\n", " 'Uh, oh.', \"Hi, honey. Uh, oh. How's the marriage retreat going?\",\n", " 'Please Dad.',\n", @@ -571,16 +563,15 @@ " \"Well, if that's the way you feel... I'll throw it back.\",\n", " 'Oh yeah, sure.', 'Watch.',\n", " \"Wow, I did it! I gave up fame and breakfast for my marriage. I fought it for six hours. She says one word and I toss it back. And you're telling me our marriage is in trouble? Come here, baby.\",\n", - " 'Ohhh, Homer.', nan, \"We're back!\", \"How's your marriage?\",\n", + " 'Ohhh, Homer.', \"We're back!\", \"How's your marriage?\",\n", " 'Same as usual. Perfectomundo.',\n", " \"Oh my, the house looks wonderful. Grampa, what's your secret?\",\n", " \"Pretending to cry. That's right, you heard me. Pretending to cry. I can turn it on and off like a fawcet. Boo-hoo, Oh, I'm crying, I'm so sad.\",\n", " 'Way to go, Grampa.', \"I'll never trust another old person.\",\n", - " 'I fooled you. So long suckers. Hee hee hee.', nan,\n", + " 'I fooled you. So long suckers. Hee hee hee.',\n", " \"Yup. General Sherman. They say he's 500 pounds of bottom-dwelling fury, don't you know? No one knows how old he is, but if you ask me, and most people do, he's a hundred years if he's a day.\",\n", " \"And uh, no one's ever caught him?\",\n", " 'Well, one fella came close. Went by the name of Homer. Seven feet tall he was, with arms like tree trunks. And his eyes were like steel, cold and hard. Had a shock of hair, red, like the fires of hell.',\n", - " nan,\n", " \"Hurry, Mom! If we don't get to the convention soon, all the good comics will be gone.\",\n", " \"Wow! Number nine! That's before Fallout Boy became his ward.\",\n", " 'What do you care about good comics? All you ever buy is Casper the Wimpy Ghost.',\n", @@ -592,7 +583,7 @@ " 'Now, Radioactive Man: He rules! Never punches a bad guy without saying something cool.',\n", " \"He's no wittier than the next superhero.\",\n", " 'Oh, yeah? Look. He knocks a guy into the sun and says, \"Hot enough for ya?\"',\n", - " 'I stand corrected.', \"We're here!\", nan, nan,\n", + " 'I stand corrected.', \"We're here!\",\n", " \"Too bad we didn't come dressed as popular cartoon characters.\",\n", " 'This looks like a discount for...', 'Bartman!',\n", " 'Who are you supposed to be?', \"I'm Bartman!\",\n", @@ -628,7 +619,7 @@ " \"It is, my lad. But I'll let you have it for a hundred because you remind me of me.\",\n", " 'All I got is thirty.', 'Then you cannot have it.',\n", " 'But I must. Until this moment, I never knew why God put me on this earth, but now I know... to buy that comic book.',\n", - " 'Your emotion is out of place here, son.', nan,\n", + " 'Your emotion is out of place here, son.',\n", " 'So, did you kids have fun?',\n", " 'Yeah, Mom! Guess what? For a dollar a man sold me thirty-five Caspers and a dozen Lois Lanes.',\n", " 'Ohhh.',\n", @@ -640,7 +631,7 @@ " 'I need a hundred dollars for a comic book.',\n", " 'A hundred bucks?! For a comic book? Who drew it, Micha-ma-langelo?',\n", " 'Oh please, Dad. I want this more than anything in the world.',\n", - " 'Well, t.s.', nan, 'Please Dad.', 'No.', 'Please Dad.', 'No.',\n", + " 'Well, t.s.', 'Please Dad.', 'No.', 'Please Dad.', 'No.',\n", " 'Please Dad.', 'No.', 'Please Dad.', 'No.', 'Please Dad.', 'No.',\n", " 'Please Dad.', 'No.', 'Please Dad.', 'No.', 'Please Dad.',\n", " \"No! Now, look, son, we all know that usually when you bug me like this, I give in, so I'm not mad at you for trying. It shows you've been paying attention. But we all know I'm not gonna give you a hundred dollars. Now are you gonna stop bugging me?\",\n", @@ -650,7 +641,7 @@ " 'Are you?', 'Okay.',\n", " 'Hee hee, I win! In your face! Yeah! How do you like them apples? Woo hoo hoo!',\n", " \"Don't gloat, Homer. You know, Bart, when I was your age, the one thing I wanted more than anything in the world was a Child-sized Electric Lightbulb Oven. My parents wouldn't give me the money, so I went to my sisters, Patty and Selma...\",\n", - " nan, \"We'll give you half our allowance.\",\n", + " \"We'll give you half our allowance.\",\n", " 'Uh-huh. But you have to be our slave.',\n", " 'This gives us a lot more free time.',\n", " \"Uh-huh. Let's take up smoking.\",\n", @@ -659,22 +650,22 @@ " 'We want those dress-shields hand-washed and drip-dried.',\n", " 'Haw haw!', 'Here we are.',\n", " \"But the big day finally came. And because I'd worked for it, all those lightbulb-warmed treats always tasted extra-good.\",\n", - " nan, 'So maybe a part-time job is the answer.',\n", + " 'So maybe a part-time job is the answer.',\n", " \"Aw, Mom, I couldn't ask you to do that. You're already taking care of Maggie, and Lisa is such a handful --\",\n", " 'She means you should get a job, stupid.', 'Me?',\n", " \"Get a job! Were they serious? I didn't realize it at the time, but a little piece of my childhood had slipped away... forever.\",\n", " 'Bart! What are you staring at?', 'Uh... nothing.',\n", " \"He didn't say it, and neither did I, but at that moment my dad and I were closer than we ever...\",\n", - " 'Bart! Stop it!', 'Sorry.', nan,\n", + " 'Bart! Stop it!', 'Sorry.',\n", " 'I NEED SOME MONEY / A LOT OF MONEY... AHH',\n", " 'Empty bottles... empty bottles...',\n", - " \"Hm... well, it's practically empty.\", nan, 'Here you go, Apu.',\n", + " \"Hm... well, it's practically empty.\", 'Here you go, Apu.',\n", " 'Ooh, very good. Would you like the deposit defrayed from the cost of a Jumbo Cherry Squishie?',\n", " 'No, not today. I need the dime.',\n", - " 'Oh, it is good to see you are learning a trade.', nan, 'Ah-ha!',\n", - " nan, 'Americanize this, my good man.', 'Okey dokey.',\n", + " 'Oh, it is good to see you are learning a trade.', 'Ah-ha!',\n", + " 'Americanize this, my good man.', 'Okey dokey.',\n", " 'All those coins were only worth three lousy cents?',\n", - " 'Let the good times roll.', nan,\n", + " 'Let the good times roll.',\n", " 'Oh, this is so humiliating... I feel like such a geek.',\n", " \"How's it going, Bart?\",\n", " \"Terrible. Cars slow down to laugh at me, but no one's buying.\",\n", @@ -690,23 +681,21 @@ " \"We-ell, seeing as how it's a first offense...\",\n", " 'I guess we can overlook this.', 'So long, officers. Uh-oh.',\n", " \"Hey, what's all the --\",\n", - " 'My beer... my beer... my beautiful beer.', nan,\n", + " 'My beer... my beer... my beautiful beer.',\n", " 'The poor boy is so desperate. He wants to earn money to buy a comic book.',\n", " 'A comic book! Oh, my, boys never change. Which one is it, \"Nazi Smasher\"?',\n", " \"I don't think so.\",\n", " \"Send him over to my house, I got a few chores he could do. He knows how to mix whitewash, don't he?\",\n", - " nan, 'Mrs. Glick?',\n", + " 'Mrs. Glick?',\n", " \"Eh, you must be Burt Simpson! Well, you look like you've got a strong young back!\",\n", " \"Would you like something to eat? I've got dried apricots... almond paste, sauerkraut candy.\",\n", " \"No, thanks. Who's that?\",\n", " \"Oh, that's my brother, Asa. He was killed in the Great War. Held a grenade too long.\",\n", - " nan,\n", " \"This one's for you Kaiser Bill. Special delivery from Uncle Sam and all the boys in D Company: Yeah! Johnny, Harrison, Brooklyn Bob and Reggie. Yeah, even Reggie. He ain't so stuck-up once you get to know...\",\n", " 'Here, have some ribbon candy. Boys love candy.', 'No, thanks.',\n", " 'Boys love candy.', \"Oh, yes, ma'am!\",\n", " \"Ugh, I think I'd rather just get to work, Ma'am.\",\n", " \"We'll start with a little light yard work. And when you're done, you can have a nice barley pop.\",\n", - " nan,\n", " 'I want you to clear out all the weeds. You do know which ones are weeds?',\n", " \"All of 'em?\", 'Good boy.',\n", " \"Now be careful with these. I'll be inside watching my stories.\",\n", @@ -717,7 +706,7 @@ " \"Merciful heavens, you're bleeding! I'll get the iodine.\",\n", " \"Now, don't fidget.\",\n", " \"Listen, lady, you don't have to -- YAAAUUUUGGGHHH!\",\n", - " \"They've never improved on iodine.\", nan, 'Hi, Mom.',\n", + " \"They've never improved on iodine.\", 'Hi, Mom.',\n", " 'Did you make any money?',\n", " \"Not yet, but at least I'm in a lot of pain.\",\n", " \"Well, I think what you're doing for Mrs. Glick is very nice. The poor old thing doesn't have anybody.\",\n", @@ -730,21 +719,20 @@ " 'Great story, lady.',\n", " 'Last night I dreamed I held you in my arms.',\n", " 'No! No, not the iodine! Burn the germs off with a torch, amputate my arm, but not the -- YAAAUUUGGGHHH!',\n", - " nan,\n", " \"Well, it's payday. I'll wager you've been looking forward to this.\",\n", - " nan, 'Two quarters.', 'Two quarters?',\n", + " 'Two quarters.', 'Two quarters?',\n", " \"You deserve every penny. You know, I've told a lot of my girlfriends about you and they have chores too.\",\n", " 'Two quarters!', \"Bart, you didn't say thank you.\",\n", " \"Listen lady, I can leave without screaming, and I can leave without saying a bad word, but there's no way that I am saying thank you.\",\n", " \"You're welcome. All right then, off you go, to spend it on penny whistles and moon pies.\",\n", - " nan, 'Moon pies, my butt... Somebody oughta moon pie her...',\n", + " 'Moon pies, my butt... Somebody oughta moon pie her...',\n", " \"What's the problem, boy?\",\n", " \"I've been bustin' my hump all week for that withered old clam, and all I got was fifty cents.\",\n", " 'Hey, when I was your age, fifty cents was a lot of money.',\n", " 'Really?', 'Nah.',\n", " \"Dad, I've done everything I could and I've only got thirty-five bucks. Ugh.. I am through with working. Working is for chumps.\",\n", " \"Son, I'm proud of you. I was twice your age before I figured that out.\",\n", - " nan, 'Can you let me have it for forty dollars?',\n", + " 'Can you let me have it for forty dollars?',\n", " 'Forty bucks? Forget it! You made me get off my stool for that?',\n", " \"It's all I've got. I sold seeds. I visited my aunt in the nursing home. I fished a dime out of the sewer, for God's sake!\",\n", " 'No way. What do you want?', 'Can I have it for thirty-five?',\n", @@ -759,7 +747,7 @@ " 'This is the stuff dreams are made of.',\n", " 'It smells like my grandpa.',\n", " 'Uh-oh, looks like rain. We better get this baby home.', 'Uh-oh.',\n", - " 'Looks like you bought more than you bargained for.', nan,\n", + " 'Looks like you bought more than you bargained for.',\n", " 'My pants... caught on barbed wire... Good Lord Choke... an A-bomb!',\n", " 'Yaarrgh!',\n", " \"I'm becoming radioactive. From this day forward, I shall call myself Radioactive Man.\",\n", @@ -787,7 +775,7 @@ " 'Yeah, sure you did.', \"Bart, don't push him!\",\n", " \"I knew it. You're both against me! Well, nobody makes a sap out of Bartholemew J. Simpson.\",\n", " \"I thought you boys might like some milk and microwave s'mores.\",\n", - " 'Thank you, Mrs. Simpson.', 'Sweet dreams, boys.', nan, nan,\n", + " 'Thank you, Mrs. Simpson.', 'Sweet dreams, boys.',\n", " \"One more step and you're a dead man.\",\n", " 'I have to go to the bathroom, Bart.',\n", " \"Yeah, right, so do I, but you don't see me gettin' up.\",\n", @@ -802,10 +790,9 @@ " \"You're going crazy, Bart. I'm telling your mom!\",\n", " 'Hey Martin, tell him what we do with squealers.',\n", " \"I don't know. Is it worse than what you do with people that have to go to the bathroom?\",\n", - " \"You can't stop me.\", \"The hell I can't!\", nan,\n", + " \"You can't stop me.\", \"The hell I can't!\",\n", " \"Homer, it's really coming down. Could you check on the boys?\",\n", - " \"They're fine.\", nan, 'Bart, the comic!',\n", - " \"Don't let go of me Bart!\",\n", + " \"They're fine.\", 'Bart, the comic!', \"Don't let go of me Bart!\",\n", " \"Milhouse, it's not that far to the ground. And the rain has probably softened it up a bit.\",\n", " 'No, Bart! No!',\n", " \"You know, if you guys hadn't tied me up, I could be saving the comic as we speak.\",\n", @@ -814,17 +801,17 @@ " \"Boys, you better come in the house. You don't want to get the sniffles.\",\n", " 'Aw, Mom.',\n", " \"Now come on... You can play your little tie-up game inside. I've got some cocoa on the stove. Who wants imitation marshmallows?\",\n", - " \"I'd raise my hand, Mrs. Simpson, if I could.\", nan, nan,\n", + " \"I'd raise my hand, Mrs. Simpson, if I could.\",\n", " \"It's no use, fellows. Another comic book has returned to the earth from whence it came.\",\n", " \"We worked so hard and now it's all gone... We ended up with nothing because the three of us can't share.\",\n", " \"What's your point?\", 'Nothing. It just kind of ticks me off.',\n", - " 'Well, the world is safe again... but for how long?', nan,\n", + " 'Well, the world is safe again... but for how long?',\n", " 'Ah, Chief Wiggum, Archbishop McGee, distinguished guests. I am pleased to dedicate this emergency warning system. In the uh, off chance of a nuclear disaster, this sign will tell you, the good citizens of Springfield, what to do.',\n", " \"Joke's on them. If the core explodes, there won't be any power to light that sign.\",\n", " 'And now, I would like to present the man who made this sign possible, by dropping the last of his obstructionist legal challenges... Montgomery Burns.',\n", " 'Mr. Burns is never late. Something must be terribly wrong.',\n", " 'Well, there better be. Nobody leaves Diamond Joe Quimby holding the bag!',\n", - " nan, 'Must... turn... over. Got to... greet... dignitaries!',\n", + " 'Must... turn... over. Got to... greet... dignitaries!',\n", " \"Oh, no, Mr. Burns! We've got to get a doctor!\",\n", " \"Absolutely not! No quack sawbones is going to apply his leeches to me! As long as there's an ounce of strength left in me, I...\",\n", " \"Mmmm. Mr. Burns is suffering from what we medical men call hypohemia. In layman's terms it's quite simply a lack of blood.\",\n", @@ -835,13 +822,12 @@ " \"I'm afraid it's not that simple. His blood type is Double-O-Negative. It's quite rare.\",\n", " \"But I'm B positive. Damn this common gutter blood in my veins!\",\n", " \"Smithers, don't feel so bad. After all, that kidney you donated to me really hit the spot.\",\n", - " nan, 'How many hairs on my head? Without looking!', 'Go ahead.',\n", - " nan,\n", + " 'How many hairs on my head? Without looking!', 'Go ahead.',\n", " \"Attention all employees. Our boss and inspiration, Mr. Burns... is at death ... death's door. If you have type Double-O-Negative blood, I implore you to report to the Bloodmobile outside. That is all.\",\n", " \"I'd give him my blood, except for one thing.\", \"What's that?\",\n", " \"I don't wanna.\",\n", " \"I can't believe you guys. There's a human being out there with millions of dollars who needs our help. And you don't wanna cash in? That's why you losers are stuck in this crummy, dead end job.\",\n", - " 'You know, Homer, I am your supervisor.', 'Sorry, sir.', nan,\n", + " 'You know, Homer, I am your supervisor.', 'Sorry, sir.',\n", " \"Maggie, look. What's that?\", 'Lee-mur. Lee-mur.',\n", " 'Zee-boo. Zee-boo.', 'What are you doing, honey?',\n", " \"I'm trying to teach Maggie that nature doesn't end with the barnyard. I want her to have all the advantages that I didn't have.\",\n", @@ -864,27 +850,25 @@ " \"Hey, wait a minute. I don't have to give blood. I have rights, you know.\",\n", " 'Yeah, you have the right to remain silent.',\n", " \"Bart, you have to help someone in need. It's the only decent thing to do.\",\n", - " nan,\n", " \"Bart, it's not like I'm asking you to give blood for free. That would be crazy! You're a little young to understand this, but when you save a rich man's life, he showers you with riches. Don't you know the story of Hercules and the Lion?\",\n", " 'Is it a Bible story?',\n", " 'Yeah, probably. Anyway, once upon a time there was a big mean lion who got a thorn in his paw. And all the village people tried to pull it out, but nobody was strong enough. So they got Hercules, and Hercules used his mighty strength, and bingo. Anyway, the moral is, the lion was so happy, he gave Hercules this big thing of riches.',\n", - " 'How did a lion get rich?', 'It was the olden days!', 'Oh.', nan,\n", + " 'How did a lion get rich?', 'It was the olden days!', 'Oh.',\n", " \"Hey, let's go! Emergency! Life-or-death here!\",\n", - " 'Just a sec, man!', nan, 'Whoa, Otto-man! You work here?',\n", + " 'Just a sec, man!', 'Whoa, Otto-man! You work here?',\n", " 'Oh yeah! During the day, all my friends are in school, so I got a job as a Certified Bloodletting Tech Dude.',\n", " \"Now let's get the show on the road.\", 'Okay. Let me wash up.',\n", " \"Homer, brave young Bart. I don't know which one to hug first.\",\n", - " 'Eh.... the boy.', nan, \"We're ready with the transfusion.\",\n", + " 'Eh.... the boy.', \"We're ready with the transfusion.\",\n", " \"Smithers, I'm not going to make it. I want to dictate... my epitaph.\",\n", " 'Charles... Montgomery... Burns.', 'Um, hmm.', 'American Patriot',\n", " '... American Patriot.', 'Master Of The Atom.',\n", " 'Scourge Of The Despot.',\n", " '\"O Tyrant Hear His Mighty Name And QUAKE!!\" Smithers, I\\'m back!',\n", - " nan,\n", " \"Oh, top o' the mornin' to ye! Why, look who's here! It's good old... you!\",\n", " 'Hi, Mr. Burns.',\n", " 'Oh, hey, there, Mr... Brown Shoes! How about that local sports team? Hm?',\n", - " \"Mr. Burns... he's okay! Jackpot!\", nan, 'Aye, caramba!',\n", + " \"Mr. Burns... he's okay! Jackpot!\", 'Aye, caramba!',\n", " \"Heh-heh-heh! Well, that's game! Hasta manana, Osvaldo!\",\n", " \"Smithers, I'm back in the pink! Full of pith and vinegar!\",\n", " 'Just remarkable, sir.',\n", @@ -892,14 +876,12 @@ " 'Uh, Bart Simpson, sir.', 'Who?',\n", " \"He's the son of Homer Simpson. One of your stiffs in Sector 7-G.\",\n", " 'Well, the Simpsons will be getting a very nice surprise in the mail. Very nice, indeed.',\n", - " nan,\n", " 'Bill... Bill... Summons... Bill... Wait a minute. From C.M. Burns? Is this it? Yes, this is it! Woo-hoo! Woo!',\n", " \"Marge! Lisa! Maggie! Let's do this out in the yard where the neighbors can see!\",\n", " 'Lisa, dim the lights! No, turn on more lights! But do something!',\n", " 'Yes, Dad.',\n", " \"It's a little thin, but that's okay, could be a check.\",\n", " 'The meaning of what?', '\"Better half,\" Marge. \"Better half.\"',\n", - " nan,\n", " 'All right, there\\'s no check, just a card. But don\\'t panic. I\\'m sure it tells us what we\\'re getting and where we can pick it up. \"Dear Bart... Thank you kindly for the blood. Yours truly, Montgomery Burns.\" It\\'s just a card!',\n", " \"This is some way to show your gratitude. No gold. No diamonds. No rubies. Not even a lousy card. Wait a minute, there was a card. That's what got me so mad in the first place.\",\n", " \"Homer, you don't do things like that to be rewarded. You do them because a fellow human being needs a helping hand.\",\n", @@ -910,16 +892,14 @@ " '\"Dear Mr. Burns. I\\'m so glaaad you enjoyed my son\\'s blood. And your caard was just great. In case you can\\'t tell, I\\'m being sarcastic. You stink!\" Could you read that last part back to me?',\n", " 'You stink.',\n", " 'Good. \"You are a senile, buck-toothed old mummy with bony girl arms... and you smell like...\"',\n", - " \"An elephant's butt?\", \"An elephant's butt.\", nan,\n", + " \"An elephant's butt?\", \"An elephant's butt.\",\n", " \"But he's your boss. Do you have to mail it right this minute?\",\n", " 'Yup!', \"You're still angry, Homer. Why don't you sleep on it?\",\n", " 'Forget it, Marge!', 'Please, Homie? For me?',\n", " 'Oh, all right. You always do that hand thing! And it usually works.',\n", - " nan, 'Cheap son-of-a...', 'Homer... Breakfast is ready.',\n", - " 'Hmmm...',\n", + " 'Cheap son-of-a...', 'Homer... Breakfast is ready.', 'Hmmm...',\n", " \"Oh, Marge, you saved me from making a big mistake. Y'know, I finally understand the meaning of mmphm hnmph.\",\n", - " 'Oh... thank you.', \"Where's the letter?\", nan, nan,\n", - " 'Where is it?',\n", + " 'Oh... thank you.', \"Where's the letter?\", 'Where is it?',\n", " \"Homer, I don't think it's in the cornstarch canister.\",\n", " \"Well, it's somewhere! It didn't just get up and walk away!\",\n", " 'Bart, have you seen the letter?', 'Yup.',\n", @@ -931,7 +911,7 @@ " \"I'll show you mad in the morning.\",\n", " 'Homer, you encouraged him. You should be strangling yourself.',\n", " \"She's right. Okay, think, Homer. Don't panic. They don't pick up the mail till noon. There's still time!\",\n", - " nan, 'Ow. Ow. Ow. Ow. Ow. Ow. Ow.',\n", + " 'Ow. Ow. Ow. Ow. Ow. Ow. Ow.',\n", " \"Give it up, Homer. It's locked up tight.\",\n", " 'Locked, eh? Well, I just might have a little surprise up my sleeve for old Mr. Lock. Step aside, boy.',\n", " \"Hey, I'm with you, Homer. Fight the power!\",\n", @@ -941,41 +921,122 @@ " 'So a few people won\\'t get a few letters. Boo-hoo. You know the kinda letters people write: \"Dear Somebody-You-Never-Heard-Of... How is So-and-So? Blah blah blah blah blah blah blah. Yours truly, Some Bozo.\" Big loss.',\n", " 'Now Bart, you keep an eye out for the mailman. Just give me some kind of signal.',\n", " 'Dad, the mailman is here.', \"That's a good one. We'll use that.\",\n", - " \"No, I mean the mailman's here.\", nan,\n", + " \"No, I mean the mailman's here.\",\n", " 'Dear God! Are you planning to water the mail?',\n", " \"Uh, uh I-I guess it wouldn't do any good to run, 'cause you're our mail lady and you know my name and address and everything, huh?\",\n", - " \"That's right.\", \"Well, I'm still gonna run!\", nan,\n", + " \"That's right.\", \"Well, I'm still gonna run!\",\n", " 'I want the whole world to hear the story of my harrowing struggle with hypohemia.',\n", " 'Well, sir, Mr. Roman is one of the finest ghostwriters in the business.',\n", " 'He\\'s written \"Like Hell I Can\\'t!\"... \"Up From The Muck\"... and \"The Unsinkable Sadruddin Mahbaradad!\"',\n", " 'Excellent.',\n", " 'All right, all right. First question? Have you slept with anyone famous?',\n", " \"Well, Countess Van Zeplin and I... What in blaze... Now you listen to me, you bargain basement Baudelaire. I'm not some dizzy starlet who can't string two words together. I can write this thing myself. You're fired.\",\n", - " nan, nan, \"Okay, Mr. Burns. What's your first name?\",\n", - " \"I don't know.\", 'Great plan, Bart.', nan,\n", + " \"Okay, Mr. Burns. What's your first name?\", \"I don't know.\",\n", + " 'Great plan, Bart.',\n", " 'Ooh, look, Maggie, what is that? Do-dec-ah-edron. Dodecahedron.',\n", " \"Lisa, I don't know what you're doing, but it's very strange and your father is trying to worry.\",\n", - " nan,\n", " '\"Chapter the Fifth... A Trip to the Infirmary, With Most Unexpected Results.\"',\n", - " nan, 'Oops.',\n", + " 'Oops.',\n", " 'Twenty eight minutes till Burns comes. Time for operation Mail Take.',\n", " 'Can I help you?',\n", " 'They always told me I was gonna destroy the family, but I never believed it.',\n", " \"Oh, don't be frightened of this. It's nothing but a letter opener. Who are you?\",\n", - " 'Homer Simpson.', nan, \"Yeah, well I'll be on my --\",\n", + " 'Homer Simpson.', \"Yeah, well I'll be on my --\",\n", " 'Hello, there\\'s more. \"In case you can\\'t tell, I\\'m being sarcastic...\"',\n", " '\"...you stink, you are a senile, buck-toothed...\" \"...old mummy... with bony girl arms and you smell like an elephant\\'s butt!\"',\n", " \"Hey, c'mon, Joey! Do you have to twist my arm?\",\n", " \"Homer, I don't tell you how to do your job. Okay?\",\n", " \"I could crush him like an ant, but it would be too easy. No, revenge is a dish best served cold. I'll bide my time until... Oh, what the hell. I'll just crush him like an ant.\",\n", - " nan,\n", " '\"Senile,\" eh? \"Buck-toothed,\" am I? \"Bony arms,\" are they? \"Liver spots,\" did I? \"Chinless,\" will you?',\n", " 'His pink slip awaits your signature, sir.',\n", - " \"Now, that's odd. I've just robbed a man of his livelihood, and yet I feel strangely empty. Tell you what, Smithers. Have him beaten to a pulp.\"],\n", + " \"Now, that's odd. I've just robbed a man of his livelihood, and yet I feel strangely empty. Tell you what, Smithers. Have him beaten to a pulp.\",\n", + " 'But, sir --', 'But what?', 'Nothing, sir.',\n", + " \"Oh, I've never seen Mr. Burns this mad and he's always kinda mad.\",\n", + " 'Me and my big... letter writing pen!',\n", + " \"Honey, what's done is done. No matter what happens, we'll pull through. We always do.\",\n", + " \"Okay, here's the plan. You can move in with your sisters and raise the kids. And I'll... die in a gutter. It's practical and within our means.\",\n", + " \"That's okay, Bart. Nobody really believed it. We were just trying to scare you.\",\n", + " 'You know Homer Simpson?',\n", + " 'Yeah, nice guy. Play poker with him once in a while.',\n", + " 'Hmmm huh. We uh, need him beaten up.', 'You got it.', 'Wait!',\n", + " 'What is it?', 'Ah, nothing.', 'Wait!', 'What?',\n", + " \"Beat, but don't kick.\", 'Hold the kicks. Got it.', 'Wait!',\n", + " 'What?', 'Uh, um, umm...', 'Hey, what did Homie do anyway?',\n", + " \"He saved Mr. Burns' life!\",\n", + " \"In closing, gentle reader, I'd like to thank you. What's that you say? Me thanking you? No, it's not a misprint. For you see, I enjoyed writing this book as much as you enjoyed reading it. The end.\",\n", + " \"Ah Smithers, how'd the beating go?\",\n", + " 'Sir, uh... there was no beating.',\n", + " \"What? Well that's a hell of a thing! Why?\",\n", + " 'Because... I... I called it off.', 'Judas!',\n", + " \"I'm sorry, sir. But I just couldn't hurt Homer Simpson. He saved your life.\",\n", + " 'I see.',\n", + " \"I know you're mad at me, but I think it's only fair to warn you, I'm going to stand outside the gate until you forgive me.\",\n", + " 'No need, Smithers. As usual, you\\'ve been the sober \"ying\" to my raging \"yang.\" Put \\'er there, old pal.',\n", + " \"Sir, while I wish this handshake would never end, I'm, I'm afraid we still have the Simpson matter to attend to.\",\n", + " 'We do indeed, old friend. We do indeed.',\n", + " \"Moe's Tavern. Where the elite meet to drink.\",\n", + " 'Eh, yeah, hello, is Mike there? Last name, Rotch.',\n", + " \"Hold on, I'll check. Mike Rotch. Mike Rotch. Hey, has anybody seen Mike Rotch, lately?\",\n", + " \"Listen you little puke. One of these days I'm gonna catch you, and I'm gonna carve my name on your back with an ice pick.\",\n", + " \"What's the matter Homer? You're not your normal effervescent self.\",\n", + " 'I got my problems, Moe. Give me another one.',\n", + " 'Homer, hey, you should not drink to forget your problems.',\n", + " 'Yeah, you should only drink to enhance your social skills.',\n", + " \"We'll get the Simpsons a present, an extravagant present! A mad, unthinkable, utterly impossible present! A frabulous, grabulous, zip-zoop-zabulous present!\",\n", + " 'Ooo, too practical.', 'Too cutesy-poo.', 'Too cornball.',\n", + " \"A pool table? Are you mad? I'm not gonna turn his home into a saloon.\",\n", + " \"Eureka! We've found it!\",\n", + " \"B-but, sir... it's thirty-two thousand dollars.\",\n", + " \"Don't you dare sully this moment with your price taggery! It's perfect!\",\n", + " 'Oh, woe is me.', \"Oh, my! It's Mr. Burns.\",\n", + " 'Heave-ho! Heave-ho! Heave-ho! Heave-ho! Heave-ho!',\n", + " \"Wait, Dad, he's smiling.\", 'Mr. Burns, you brought us a present.',\n", + " 'Why, what did you think I was going to do -- have you beaten to a bloody pulp?',\n", + " 'To show there\\'s no hard feelings, please take an advance copy of my book, \"Will There Ever Be A Rainbow?\" And now, young fellow, I haven\\'t forgotten you. Here.',\n", + " 'Wow! A crowbar!', \"It's to open the crate, stupid.\",\n", + " \"What did I tell you? I'll bet it's filled with diamonds, rubies, sapphires, pearls...\",\n", + " 'Wow! A big ugly head!',\n", + " \"Actually, son, it's a big, ugly Olmec Indian head. It was carved by Meso-American Indians over 3,000 years ago. This gruesome customer is Xt'tapalatakettle, the god of war.\",\n", + " 'Awesome!', 'No, Maggie. Not Az-tec. Ol-mec. Ol-mec.',\n", + " 'Marge, what does it do?', \"It doesn't do anything.\",\n", + " 'Marge! Really, what does it do?',\n", + " \"Whatever it does, it's doing it now.\",\n", + " \"Well, I'll let you get acquainted with Señor Xt'tapalatakettle. Ta!\",\n", + " 'Did you see their faces, Smithers?',\n", + " \"Sir, you're my god of generosity.\",\n", + " \"Save a guy's life, and whattaya get? Nothin'! Worse than nothin'! Just a big, scary rock.\",\n", + " \"Hey, man, don't bad-mouth the head.\",\n", + " 'Homer, it\\'s the thought that counts. The moral of this story is, \"A good deed is its own reward.\"',\n", + " 'Hey, we got a reward. The head is cool!',\n", + " 'Well then, I guess the moral is, \"No good deed goes unrewarded.\"',\n", + " \"Wait a minute. If I hadn't written that nasty letter, we wouldn't have gotten anything!\",\n", + " 'Well... then I guess the moral is, \"The squeaky wheel gets the grease.\"',\n", + " 'Perhaps there is no moral to this story.',\n", + " \"Exactly. It's just a bunch of stuff that happened.\",\n", + " 'But it certainly was a memorable few days!', 'Amen to that!',\n", + " 'Bart... Bart... Hey, Bart.',\n", + " \"Lisa? It's six a.m. Something's wrong! Dad died!\",\n", + " \"No, no. He's fine.\", \"Well, what do you know? I'm relieved.\",\n", + " \"Bart, my birthday is in two days. I'm gonna be eight years old. It's a big number -- almost double digits.\",\n", + " \"Well, enjoy it while you can. Everything changes when you hit the big one-oh. Your legs start to go... candy doesn't taste as good anymore --\",\n", + " 'Lisa did it.',\n", + " 'Bart, will you please let me pour my little heart out?',\n", + " \"Sorry, this old timer does ramble on sometimes, don't he?\",\n", + " \"Bart, I do so much for you and yet you have disappointed me on every one of my birthdays. I've made things for you. But you've lost or broken them in hours... but, okay, we'll forget all...\",\n", + " \"Okay, uh-huh. Okay, okay,. Okay, okay, okay okay, it's done! I'm doing it! Birthday gift coming your way!\",\n", + " 'Oh, thank you.', 'Bart, watch Maggie while I get the laundry.',\n", + " 'Can do.', 'Hm... Krusty hotline.',\n", + " \"Hi kids! You've reached the Krusty Hotline. If you haven't asked your parents' permission, naughty naughty! But Krusty forgives you! Two dollars for the first minute, fifty cents for each additional minute.\",\n", + " 'Thanks for calling kids! A new message every day.', 'Maggie!',\n", + " 'Bart, I asked you to watch your sister!',\n", + " 'I tried to stop her but she overpowered me.',\n", + " 'Who stole my shirt? Who stole my shirt?', 'I washed it.',\n", + " 'Oh thank you, Marge -- Pink?',\n", + " \"Marge, I can't wear a pink shirt to work. Everybody wears white shirts. I'm not popular enough to be different.\"],\n", " dtype=object)" ] }, - "execution_count": 17, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -986,9 +1047,72 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 9, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Collecting spacy\n", + "\u001b[?25l Downloading https://files.pythonhosted.org/packages/9a/2a/057bca697905031a6179227278a49fe9e7841a6d444bc2e13f1266b9f7dc/spacy-2.1.8-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (34.4MB)\n", + "\u001b[K 100% |████████████████████████████████| 34.4MB 671kB/s ta 0:00:011 11% |███▊ | 4.0MB 41.1MB/s eta 0:00:01\n", + "\u001b[?25hCollecting preshed<2.1.0,>=2.0.1 (from spacy)\n", + "\u001b[?25l Downloading https://files.pythonhosted.org/packages/48/fe/2f2e8c91541785f2abe0d51f37eb00356513b9ff3d24fb27fd5b59e18264/preshed-2.0.1-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (145kB)\n", + "\u001b[K 100% |████████████████████████████████| 153kB 22.6MB/s ta 0:00:01\n", + "\u001b[?25hRequirement already satisfied: numpy>=1.15.0 in /anaconda3/lib/python3.7/site-packages (from spacy) (1.16.2)\n", + "Collecting murmurhash<1.1.0,>=0.28.0 (from spacy)\n", + " Downloading https://files.pythonhosted.org/packages/b9/bd/faace403086ee922afc74e5615cb8c21020fcf5d5667314e943c08f71fde/murmurhash-1.0.2-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl\n", + "Collecting plac<1.0.0,>=0.9.6 (from spacy)\n", + " Downloading https://files.pythonhosted.org/packages/9e/9b/62c60d2f5bc135d2aa1d8c8a86aaf84edb719a59c7f11a4316259e61a298/plac-0.9.6-py2.py3-none-any.whl\n", + "Collecting cymem<2.1.0,>=2.0.2 (from spacy)\n", + "\u001b[?25l Downloading https://files.pythonhosted.org/packages/d7/11/37da628920bf2999bd8c4ffc40908413622486d5dbc4e60d87a58c428367/cymem-2.0.2-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (52kB)\n", + "\u001b[K 100% |████████████████████████████████| 61kB 5.7MB/s ta 0:00:011\n", + "\u001b[?25hRequirement already satisfied: requests<3.0.0,>=2.13.0 in /anaconda3/lib/python3.7/site-packages (from spacy) (2.21.0)\n", + "Collecting srsly<1.1.0,>=0.0.6 (from spacy)\n", + "\u001b[?25l Downloading https://files.pythonhosted.org/packages/66/ab/a26c85fe8e4d416a482bdafa4ea36fb59add449f0d00ec45ab51036528e3/srsly-0.1.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (272kB)\n", + "\u001b[K 100% |████████████████████████████████| 276kB 2.3MB/s ta 0:00:01\n", + "\u001b[?25hCollecting wasabi<1.1.0,>=0.2.0 (from spacy)\n", + " Downloading https://files.pythonhosted.org/packages/f4/c1/d76ccdd12c716be79162d934fe7de4ac8a318b9302864716dde940641a79/wasabi-0.2.2-py3-none-any.whl\n", + "Collecting thinc<7.1.0,>=7.0.8 (from spacy)\n", + "\u001b[?25l Downloading https://files.pythonhosted.org/packages/e1/36/a9b47b517266b8ece0c6aa5477deb9c71b809645e8f92871a2480c1a8407/thinc-7.0.8-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (2.9MB)\n", + "\u001b[K 100% |████████████████████████████████| 2.9MB 2.5MB/s ta 0:00:01\n", + "\u001b[?25hCollecting blis<0.3.0,>=0.2.2 (from spacy)\n", + "\u001b[?25l Downloading https://files.pythonhosted.org/packages/36/41/9e934e2b8a2cdae447ed1923a94f98c2d70c898b65af6635f5fe55f7ed4d/blis-0.2.4-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (3.0MB)\n", + "\u001b[K 100% |████████████████████████████████| 3.0MB 2.8MB/s ta 0:00:011 60% |███████████████████▌ | 1.8MB 3.4MB/s eta 0:00:01\n", + "\u001b[?25hRequirement already satisfied: certifi>=2017.4.17 in /anaconda3/lib/python3.7/site-packages (from requests<3.0.0,>=2.13.0->spacy) (2019.3.9)\n", + "Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /anaconda3/lib/python3.7/site-packages (from requests<3.0.0,>=2.13.0->spacy) (3.0.4)\n", + "Requirement already satisfied: idna<2.9,>=2.5 in /anaconda3/lib/python3.7/site-packages (from requests<3.0.0,>=2.13.0->spacy) (2.8)\n", + "Requirement already satisfied: urllib3<1.25,>=1.21.1 in /anaconda3/lib/python3.7/site-packages (from requests<3.0.0,>=2.13.0->spacy) (1.24.1)\n", + "Requirement already satisfied: tqdm<5.0.0,>=4.10.0 in /anaconda3/lib/python3.7/site-packages (from thinc<7.1.0,>=7.0.8->spacy) (4.31.1)\n", + "Installing collected packages: cymem, preshed, murmurhash, plac, srsly, wasabi, blis, thinc, spacy\n", + "Successfully installed blis-0.2.4 cymem-2.0.2 murmurhash-1.0.2 plac-0.9.6 preshed-2.0.1 spacy-2.1.8 srsly-0.1.0 thinc-7.0.8 wasabi-0.2.2\n" + ] + } + ], + "source": [ + "!pip install spacy" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "ename": "OSError", + "evalue": "[E050] Can't find model 'en_core_web_lg'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mOSError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mspacy\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mdocs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mnlp\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mspacy\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'en_core_web_lg'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 4\u001b[0m \u001b[0mcount\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mdoc\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mnlp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpipe\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlines\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/anaconda3/lib/python3.7/site-packages/spacy/__init__.py\u001b[0m in \u001b[0;36mload\u001b[0;34m(name, **overrides)\u001b[0m\n\u001b[1;32m 25\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mdepr_path\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32min\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 26\u001b[0m \u001b[0mdeprecation_warning\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mWarnings\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mW001\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdepr_path\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 27\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mutil\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload_model\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0moverrides\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 28\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 29\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/anaconda3/lib/python3.7/site-packages/spacy/util.py\u001b[0m in \u001b[0;36mload_model\u001b[0;34m(name, **overrides)\u001b[0m\n\u001b[1;32m 137\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mhasattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"exists\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# Path or Path-like to model data\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 138\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mload_model_from_path\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0moverrides\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 139\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mIOError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mErrors\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mE050\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 140\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 141\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mOSError\u001b[0m: [E050] Can't find model 'en_core_web_lg'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory." + ] + } + ], "source": [ "import spacy\n", "docs = []\n", @@ -1000,7 +1124,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1009,7 +1133,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1018,98 +1142,16 @@ }, { "cell_type": "code", - "execution_count": 40, + "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", - "
raw_character_textspoken_wordsvectors
0Miss HooverNo, actually, it was a little of both. Sometim...[-0.07657106, 0.26351482, -0.17721403, -0.0891...
1Lisa SimpsonWhere's Mr. Bergstrom?[-0.0003000036, 0.401856, 0.020902596, -0.0411...
2Miss HooverI don't know. Although I'd sure like to talk t...[-0.011891552, 0.2516941, -0.27629453, -0.1274...
3Lisa SimpsonThat life is worth living.[-0.006498333, 0.30273068, -0.06274977, -0.257...
4Edna Krabappel-FlandersThe polls will be open from now until the end ...[0.071594164, 0.19087753, -0.110537454, -0.004...
\n", - "
" - ], - "text/plain": [ - " raw_character_text spoken_words \\\n", - "0 Miss Hoover No, actually, it was a little of both. Sometim... \n", - "1 Lisa Simpson Where's Mr. Bergstrom? \n", - "2 Miss Hoover I don't know. Although I'd sure like to talk t... \n", - "3 Lisa Simpson That life is worth living. \n", - "4 Edna Krabappel-Flanders The polls will be open from now until the end ... \n", - "\n", - " vectors \n", - "0 [-0.07657106, 0.26351482, -0.17721403, -0.0891... \n", - "1 [-0.0003000036, 0.401856, 0.020902596, -0.0411... \n", - "2 [-0.011891552, 0.2516941, -0.27629453, -0.1274... \n", - "3 [-0.006498333, 0.30273068, -0.06274977, -0.257... \n", - "4 [0.071594164, 0.19087753, -0.110537454, -0.004... " - ] - }, - "execution_count": 40, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "lines_df.head()" ] }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1118,22 +1160,9 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "NearestNeighbors(algorithm='ball_tree', leaf_size=30, metric='minkowski',\n", - " metric_params=None, n_jobs=None, n_neighbors=5, p=2,\n", - " radius=1.0)" - ] - }, - "execution_count": 28, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "nn = NearestNeighbors(n_neighbors=5, algorithm='ball_tree')\n", "nn.fit(vectors)" @@ -1141,7 +1170,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1151,7 +1180,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1160,7 +1189,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1169,7 +1198,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1179,312 +1208,55 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([125445, 122311, 32418, 34000, 47689])" - ] - }, - "execution_count": 46, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "neighbs[1][0]" ] }, { "cell_type": "code", - "execution_count": 50, + "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", - "
raw_character_textspoken_wordsvectors
40649VendorMountain Dew or crab juice.[-0.120053835, 0.07410167, 0.085148335, -0.402...
98465MichaelDandelion greens, a sprig of wild dill, fresh ...[-0.07447155, 0.2494231, -0.045560263, -0.1165...
114104Teenage StagehandMs. Nebraska, your purified water and fried ch...[-0.08589353, 0.13033754, -0.015297831, -0.121...
5433Marge SimpsonFruit leather... Tree Fresh Imitation Orange D...[-0.1189513, 0.02974447, -0.006639198, -0.2499...
90141Homer SimpsonWell, I invented a Popsicle made of Mountain Dew.[0.019181365, 0.17568728, -0.12004599, -0.3499...
\n", - "
" - ], - "text/plain": [ - " raw_character_text spoken_words \\\n", - "40649 Vendor Mountain Dew or crab juice. \n", - "98465 Michael Dandelion greens, a sprig of wild dill, fresh ... \n", - "114104 Teenage Stagehand Ms. Nebraska, your purified water and fried ch... \n", - "5433 Marge Simpson Fruit leather... Tree Fresh Imitation Orange D... \n", - "90141 Homer Simpson Well, I invented a Popsicle made of Mountain Dew. \n", - "\n", - " vectors \n", - "40649 [-0.120053835, 0.07410167, 0.085148335, -0.402... \n", - "98465 [-0.07447155, 0.2494231, -0.045560263, -0.1165... \n", - "114104 [-0.08589353, 0.13033754, -0.015297831, -0.121... \n", - "5433 [-0.1189513, 0.02974447, -0.006639198, -0.2499... \n", - "90141 [0.019181365, 0.17568728, -0.12004599, -0.3499... " - ] - }, - "execution_count": 50, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "lines_df.iloc[neighbs[1][0]]" ] }, { "cell_type": "code", - "execution_count": 51, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def find_quotes(inp_str):\n", " vect = get_vectors_of_string(inp_str)\n", " closest_quotes = nn.kneighbors([vect])\n", - " return lines_df.iloc[closest_quotes[1][0]]\n" + " return lines_df.iloc[closest_quotes[1][0]]" ] }, { "cell_type": "code", - "execution_count": 59, + "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", - "
raw_character_textspoken_wordsvectors
101746Gary ChalmersBut you do live in the district.[0.026252124, 0.17488113, -0.1543875, -0.08782...
34275Hank ScorpioThat might... Matter of fact, they're all in t...[-0.0005717829, 0.19351904, -0.08779617, -0.11...
87637CHLOETwo things are certain -- the mayor is in deep...[0.026974047, 0.052787412, -0.14665185, -0.108...
20066Seymour SkinnerIf the jury is deadlocked, they're put up in a...[0.021742309, 0.17655937, -0.11094219, -0.0486...
123963FatherWhat the hell are you making chairs for? In th...[-0.022090739, 0.13985485, -0.12785573, -0.086...
\n", - "
" - ], - "text/plain": [ - " raw_character_text spoken_words \\\n", - "101746 Gary Chalmers But you do live in the district. \n", - "34275 Hank Scorpio That might... Matter of fact, they're all in t... \n", - "87637 CHLOE Two things are certain -- the mayor is in deep... \n", - "20066 Seymour Skinner If the jury is deadlocked, they're put up in a... \n", - "123963 Father What the hell are you making chairs for? In th... \n", - "\n", - " vectors \n", - "101746 [0.026252124, 0.17488113, -0.1543875, -0.08782... \n", - "34275 [-0.0005717829, 0.19351904, -0.08779617, -0.11... \n", - "87637 [0.026974047, 0.052787412, -0.14665185, -0.108... \n", - "20066 [0.021742309, 0.17655937, -0.11094219, -0.0486... \n", - "123963 [-0.022090739, 0.13985485, -0.12785573, -0.086... " - ] - }, - "execution_count": 59, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "find_quotes(\"they're all in the hammock district\")" ] }, { "cell_type": "code", - "execution_count": 60, + "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", - "
raw_character_textspoken_wordsvectors
153503Homer SimpsonSmothered pork chops.[-0.38019222, -0.1277625, 0.34242252, 0.077048...
49564Homer SimpsonSteamed Maine cabbages![-0.277914, -0.041433744, -0.075511254, -0.372...
32674Gary ChalmersFor \"steamed hams.\"[-0.20388983, 0.04237333, -0.18209751, -0.1394...
32664Gary ChalmersYou call hamburgers \"steamed hams?\"[-0.22379924, 0.09646686, -0.088719375, 0.0168...
110504Moe SzyslakHam sandwiches![-0.33784032, -0.18016668, 0.46686664, 0.22452...
\n", - "
" - ], - "text/plain": [ - " raw_character_text spoken_words \\\n", - "153503 Homer Simpson Smothered pork chops. \n", - "49564 Homer Simpson Steamed Maine cabbages! \n", - "32674 Gary Chalmers For \"steamed hams.\" \n", - "32664 Gary Chalmers You call hamburgers \"steamed hams?\" \n", - "110504 Moe Szyslak Ham sandwiches! \n", - "\n", - " vectors \n", - "153503 [-0.38019222, -0.1277625, 0.34242252, 0.077048... \n", - "49564 [-0.277914, -0.041433744, -0.075511254, -0.372... \n", - "32674 [-0.20388983, 0.04237333, -0.18209751, -0.1394... \n", - "32664 [-0.22379924, 0.09646686, -0.088719375, 0.0168... \n", - "110504 [-0.33784032, -0.18016668, 0.46686664, 0.22452... " - ] - }, - "execution_count": 60, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "find_quotes(\"steamed hams\")" ] }, { "cell_type": "code", - "execution_count": 75, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1495,32 +1267,16 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Collecting tensorflow_hub\n", - "\u001b[?25l Downloading https://files.pythonhosted.org/packages/b5/be/f18c352d84382d9c795a0f37eaf16d42ace7d161fbb0ad20bdcd5e550015/tensorflow_hub-0.5.0-py2.py3-none-any.whl (78kB)\n", - "\u001b[K |████████████████████████████████| 81kB 12.8MB/s eta 0:00:01\n", - "\u001b[?25hRequirement already satisfied: numpy>=1.12.0 in /home/will/anaconda3/envs/gpu/lib/python3.6/site-packages (from tensorflow_hub) (1.16.4)\n", - "Requirement already satisfied: six>=1.10.0 in /home/will/anaconda3/envs/gpu/lib/python3.6/site-packages (from tensorflow_hub) (1.12.0)\n", - "Requirement already satisfied: protobuf>=3.4.0 in /home/will/anaconda3/envs/gpu/lib/python3.6/site-packages (from tensorflow_hub) (3.9.1)\n", - "Requirement already satisfied: setuptools in /home/will/anaconda3/envs/gpu/lib/python3.6/site-packages (from protobuf>=3.4.0->tensorflow_hub) (41.0.1)\n", - "Installing collected packages: tensorflow-hub\n", - "Successfully installed tensorflow-hub-0.5.0\n" - ] - } - ], + "outputs": [], "source": [ "!pip install tensorflow_hub" ] }, { "cell_type": "code", - "execution_count": 77, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1552,31 +1308,9 @@ }, { "cell_type": "code", - "execution_count": 78, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "ename": "InternalError", - "evalue": "Dst tensor is not initialized.\n\t [[node checkpoint_initializer_73 (defined at /home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow_hub/native_module.py:407) ]]\n\nOriginal stack trace for 'checkpoint_initializer_73':\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/runpy.py\", line 193, in _run_module_as_main\n \"__main__\", mod_spec)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/runpy.py\", line 85, in _run_code\n exec(code, run_globals)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/ipykernel_launcher.py\", line 16, in \n app.launch_new_instance()\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/traitlets/config/application.py\", line 658, in launch_instance\n app.start()\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/ipykernel/kernelapp.py\", line 563, in start\n self.io_loop.start()\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tornado/platform/asyncio.py\", line 148, in start\n self.asyncio_loop.run_forever()\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/asyncio/base_events.py\", line 438, in run_forever\n self._run_once()\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/asyncio/base_events.py\", line 1451, in _run_once\n handle._run()\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/asyncio/events.py\", line 145, in _run\n self._callback(*self._args)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tornado/ioloop.py\", line 690, in \n lambda f: self._run_callback(functools.partial(callback, future))\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tornado/ioloop.py\", line 743, in _run_callback\n ret = callback()\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tornado/gen.py\", line 787, in inner\n self.run()\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tornado/gen.py\", line 748, in run\n yielded = self.gen.send(value)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/ipykernel/kernelbase.py\", line 365, in process_one\n yield gen.maybe_future(dispatch(*args))\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tornado/gen.py\", line 209, in wrapper\n yielded = next(result)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/ipykernel/kernelbase.py\", line 272, in dispatch_shell\n yield gen.maybe_future(handler(stream, idents, msg))\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tornado/gen.py\", line 209, in wrapper\n yielded = next(result)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/ipykernel/kernelbase.py\", line 542, in execute_request\n user_expressions, allow_stdin,\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tornado/gen.py\", line 209, in wrapper\n yielded = next(result)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/ipykernel/ipkernel.py\", line 294, in do_execute\n res = shell.run_cell(code, store_history=store_history, silent=silent)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/ipykernel/zmqshell.py\", line 536, in run_cell\n return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/IPython/core/interactiveshell.py\", line 2855, in run_cell\n raw_cell, store_history, silent, shell_futures)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/IPython/core/interactiveshell.py\", line 2881, in _run_cell\n return runner(coro)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/IPython/core/async_helpers.py\", line 68, in _pseudo_sync_runner\n coro.send(None)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/IPython/core/interactiveshell.py\", line 3058, in run_cell_async\n interactivity=interactivity, compiler=compiler, result=result)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/IPython/core/interactiveshell.py\", line 3249, in run_ast_nodes\n if (await self.run_code(code, result, async_=asy)):\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/IPython/core/interactiveshell.py\", line 3326, in run_code\n exec(code_obj, self.user_global_ns, self.user_ns)\n File \"\", line 4, in \n embed = hub.Module(module_url)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow_hub/module.py\", line 170, in __init__\n tags=self._tags)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow_hub/native_module.py\", line 340, in _create_impl\n name=name)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow_hub/native_module.py\", line 399, in __init__\n self._init_state(name)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow_hub/native_module.py\", line 407, in _init_state\n self._variable_map)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/training/checkpoint_utils.py\", line 291, in init_from_checkpoint\n init_from_checkpoint_fn)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/distribute/distribute_lib.py\", line 1684, in merge_call\n return self._merge_call(merge_fn, args, kwargs)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/distribute/distribute_lib.py\", line 1691, in _merge_call\n return merge_fn(self._strategy, *args, **kwargs)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/training/checkpoint_utils.py\", line 286, in \n ckpt_dir_or_file, assignment_map)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/training/checkpoint_utils.py\", line 334, in _init_from_checkpoint\n _set_variable_or_list_initializer(var, ckpt_file, tensor_name_in_ckpt)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/training/checkpoint_utils.py\", line 458, in _set_variable_or_list_initializer\n _set_checkpoint_initializer(variable_or_list, ckpt_file, tensor_name, \"\")\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/training/checkpoint_utils.py\", line 412, in _set_checkpoint_initializer\n ckpt_file, [tensor_name], [slice_spec], [base_type], name=name)[0]\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/ops/gen_io_ops.py\", line 1696, in restore_v2\n name=name)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py\", line 788, in _apply_op_helper\n op_def=op_def)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py\", line 507, in new_func\n return func(*args, **kwargs)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/framework/ops.py\", line 3616, in create_op\n op_def=op_def)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/framework/ops.py\", line 2005, in __init__\n self._traceback = tf_stack.extract_stack()\n", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mInternalError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m~/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_do_call\u001b[0;34m(self, fn, *args)\u001b[0m\n\u001b[1;32m 1355\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1356\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1357\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0merrors\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mOpError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_run_fn\u001b[0;34m(feed_dict, fetch_list, target_list, options, run_metadata)\u001b[0m\n\u001b[1;32m 1340\u001b[0m return self._call_tf_sessionrun(\n\u001b[0;32m-> 1341\u001b[0;31m options, feed_dict, fetch_list, target_list, run_metadata)\n\u001b[0m\u001b[1;32m 1342\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_call_tf_sessionrun\u001b[0;34m(self, options, feed_dict, fetch_list, target_list, run_metadata)\u001b[0m\n\u001b[1;32m 1428\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_session\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moptions\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfeed_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfetch_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtarget_list\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1429\u001b[0;31m run_metadata)\n\u001b[0m\u001b[1;32m 1430\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mInternalError\u001b[0m: Dst tensor is not initialized.\n\t [[{{node checkpoint_initializer_73}}]]", - "\nDuring handling of the above exception, another exception occurred:\n", - "\u001b[0;31mInternalError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 22\u001b[0m \u001b[0msimilarity_message_encodings\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0membed\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msimilarity_input_placeholder\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 23\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mtf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSession\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0msession\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 24\u001b[0;31m \u001b[0msession\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mglobal_variables_initializer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 25\u001b[0m \u001b[0msession\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtables_initializer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 26\u001b[0m \u001b[0mmessage_embeddings_\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msession\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msimilarity_message_encodings\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfeed_dict\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0msimilarity_input_placeholder\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mmessages\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36mrun\u001b[0;34m(self, fetches, feed_dict, options, run_metadata)\u001b[0m\n\u001b[1;32m 948\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 949\u001b[0m result = self._run(None, fetches, feed_dict, options_ptr,\n\u001b[0;32m--> 950\u001b[0;31m run_metadata_ptr)\n\u001b[0m\u001b[1;32m 951\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mrun_metadata\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 952\u001b[0m \u001b[0mproto_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtf_session\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mTF_GetBuffer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrun_metadata_ptr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_run\u001b[0;34m(self, handle, fetches, feed_dict, options, run_metadata)\u001b[0m\n\u001b[1;32m 1171\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mfinal_fetches\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mfinal_targets\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mhandle\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mfeed_dict_tensor\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1172\u001b[0m results = self._do_run(handle, final_targets, final_fetches,\n\u001b[0;32m-> 1173\u001b[0;31m feed_dict_tensor, options, run_metadata)\n\u001b[0m\u001b[1;32m 1174\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1175\u001b[0m \u001b[0mresults\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_do_run\u001b[0;34m(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)\u001b[0m\n\u001b[1;32m 1348\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mhandle\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1349\u001b[0m return self._do_call(_run_fn, feeds, fetches, targets, options,\n\u001b[0;32m-> 1350\u001b[0;31m run_metadata)\n\u001b[0m\u001b[1;32m 1351\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1352\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_do_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_prun_fn\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhandle\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfeeds\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfetches\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_do_call\u001b[0;34m(self, fn, *args)\u001b[0m\n\u001b[1;32m 1368\u001b[0m \u001b[0;32mpass\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1369\u001b[0m \u001b[0mmessage\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0merror_interpolation\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minterpolate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmessage\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_graph\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1370\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mtype\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0me\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnode_def\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mop\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmessage\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1371\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1372\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_extend_graph\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mInternalError\u001b[0m: Dst tensor is not initialized.\n\t [[node checkpoint_initializer_73 (defined at /home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow_hub/native_module.py:407) ]]\n\nOriginal stack trace for 'checkpoint_initializer_73':\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/runpy.py\", line 193, in _run_module_as_main\n \"__main__\", mod_spec)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/runpy.py\", line 85, in _run_code\n exec(code, run_globals)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/ipykernel_launcher.py\", line 16, in \n app.launch_new_instance()\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/traitlets/config/application.py\", line 658, in launch_instance\n app.start()\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/ipykernel/kernelapp.py\", line 563, in start\n self.io_loop.start()\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tornado/platform/asyncio.py\", line 148, in start\n self.asyncio_loop.run_forever()\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/asyncio/base_events.py\", line 438, in run_forever\n self._run_once()\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/asyncio/base_events.py\", line 1451, in _run_once\n handle._run()\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/asyncio/events.py\", line 145, in _run\n self._callback(*self._args)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tornado/ioloop.py\", line 690, in \n lambda f: self._run_callback(functools.partial(callback, future))\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tornado/ioloop.py\", line 743, in _run_callback\n ret = callback()\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tornado/gen.py\", line 787, in inner\n self.run()\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tornado/gen.py\", line 748, in run\n yielded = self.gen.send(value)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/ipykernel/kernelbase.py\", line 365, in process_one\n yield gen.maybe_future(dispatch(*args))\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tornado/gen.py\", line 209, in wrapper\n yielded = next(result)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/ipykernel/kernelbase.py\", line 272, in dispatch_shell\n yield gen.maybe_future(handler(stream, idents, msg))\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tornado/gen.py\", line 209, in wrapper\n yielded = next(result)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/ipykernel/kernelbase.py\", line 542, in execute_request\n user_expressions, allow_stdin,\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tornado/gen.py\", line 209, in wrapper\n yielded = next(result)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/ipykernel/ipkernel.py\", line 294, in do_execute\n res = shell.run_cell(code, store_history=store_history, silent=silent)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/ipykernel/zmqshell.py\", line 536, in run_cell\n return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/IPython/core/interactiveshell.py\", line 2855, in run_cell\n raw_cell, store_history, silent, shell_futures)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/IPython/core/interactiveshell.py\", line 2881, in _run_cell\n return runner(coro)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/IPython/core/async_helpers.py\", line 68, in _pseudo_sync_runner\n coro.send(None)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/IPython/core/interactiveshell.py\", line 3058, in run_cell_async\n interactivity=interactivity, compiler=compiler, result=result)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/IPython/core/interactiveshell.py\", line 3249, in run_ast_nodes\n if (await self.run_code(code, result, async_=asy)):\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/IPython/core/interactiveshell.py\", line 3326, in run_code\n exec(code_obj, self.user_global_ns, self.user_ns)\n File \"\", line 4, in \n embed = hub.Module(module_url)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow_hub/module.py\", line 170, in __init__\n tags=self._tags)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow_hub/native_module.py\", line 340, in _create_impl\n name=name)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow_hub/native_module.py\", line 399, in __init__\n self._init_state(name)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow_hub/native_module.py\", line 407, in _init_state\n self._variable_map)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/training/checkpoint_utils.py\", line 291, in init_from_checkpoint\n init_from_checkpoint_fn)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/distribute/distribute_lib.py\", line 1684, in merge_call\n return self._merge_call(merge_fn, args, kwargs)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/distribute/distribute_lib.py\", line 1691, in _merge_call\n return merge_fn(self._strategy, *args, **kwargs)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/training/checkpoint_utils.py\", line 286, in \n ckpt_dir_or_file, assignment_map)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/training/checkpoint_utils.py\", line 334, in _init_from_checkpoint\n _set_variable_or_list_initializer(var, ckpt_file, tensor_name_in_ckpt)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/training/checkpoint_utils.py\", line 458, in _set_variable_or_list_initializer\n _set_checkpoint_initializer(variable_or_list, ckpt_file, tensor_name, \"\")\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/training/checkpoint_utils.py\", line 412, in _set_checkpoint_initializer\n ckpt_file, [tensor_name], [slice_spec], [base_type], name=name)[0]\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/ops/gen_io_ops.py\", line 1696, in restore_v2\n name=name)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py\", line 788, in _apply_op_helper\n op_def=op_def)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py\", line 507, in new_func\n return func(*args, **kwargs)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/framework/ops.py\", line 3616, in create_op\n op_def=op_def)\n File \"/home/will/anaconda3/envs/gpu/lib/python3.6/site-packages/tensorflow/python/framework/ops.py\", line 2005, in __init__\n self._traceback = tf_stack.extract_stack()\n" - ] - } - ], + "outputs": [], "source": [ "module_url = \"https://tfhub.dev/google/universal-sentence-encoder/1?tf-hub-format=compressed\"\n", "\n", @@ -1620,9 +1354,9 @@ ], "metadata": { "kernelspec": { - "display_name": "gpu", + "display_name": "Python 3", "language": "python", - "name": "gpu" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -1634,7 +1368,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.9" + "version": "3.7.3" } }, "nbformat": 4, diff --git a/homerize.ipynb b/homerize.ipynb new file mode 100644 index 0000000..6e37995 --- /dev/null +++ b/homerize.ipynb @@ -0,0 +1,211 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "lines_df = pd.read_csv('simpsons_dataset.csv')\n", + "lines_df = lines_df.dropna()\n", + "characters = lines_df['raw_character_text'].values\n", + "lines = lines_df['spoken_words'].values" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "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", + "
raw_character_textspoken_words
0Miss HooverNo, actually, it was a little of both. Sometim...
1Lisa SimpsonWhere's Mr. Bergstrom?
2Miss HooverI don't know. Although I'd sure like to talk t...
3Lisa SimpsonThat life is worth living.
4Edna Krabappel-FlandersThe polls will be open from now until the end ...
\n", + "
" + ], + "text/plain": [ + " raw_character_text spoken_words\n", + "0 Miss Hoover No, actually, it was a little of both. Sometim...\n", + "1 Lisa Simpson Where's Mr. Bergstrom?\n", + "2 Miss Hoover I don't know. Although I'd sure like to talk t...\n", + "3 Lisa Simpson That life is worth living.\n", + "4 Edna Krabappel-Flanders The polls will be open from now until the end ..." + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "lines_df.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [], + "source": [ + "homer_lines_df = lines_df[lines_df['raw_character_text'] == 'Homer Simpson']" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "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", + "
raw_character_textspoken_words
57Homer SimpsonNever thrown a party? What about that big bash...
58Homer SimpsonBart didn't get one vote?! Oh, this is the wor...
62Homer SimpsonOh.
64Homer SimpsonAnd?
66Homer SimpsonHey, just because I don't care doesn't mean I ...
\n", + "
" + ], + "text/plain": [ + " raw_character_text spoken_words\n", + "57 Homer Simpson Never thrown a party? What about that big bash...\n", + "58 Homer Simpson Bart didn't get one vote?! Oh, this is the wor...\n", + "62 Homer Simpson Oh.\n", + "64 Homer Simpson And?\n", + "66 Homer Simpson Hey, just because I don't care doesn't mean I ..." + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "homer_lines_df.head()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/text_generation.ipynb b/text_generation.ipynb index befa16f..7d33be5 100644 --- a/text_generation.ipynb +++ b/text_generation.ipynb @@ -1764,9 +1764,9 @@ ], "metadata": { "kernelspec": { - "display_name": "gpu", + "display_name": "Python 3", "language": "python", - "name": "gpu" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -1778,7 +1778,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.9" + "version": "3.7.3" } }, "nbformat": 4,