Seinfeld RNN

September 1, 2015

Char-rnn generated Seinfeld Episode

This post explores character-level multi-layer Recurrent Neural Network as language models. It uses Andrej Karpathy’s char-rnn library char-rnn. He has a detailed blog post on it, explaining various experiments with these RNNs. There have been some interesting experiments based on it, from generating cooking recipes, bible rewrite and Obama speeches to rap and music composition. I wondered how well will it generate sample scripts of Seinfeld episodes if I train the model on all 180 episode scripts. The char-rnn code is pretty straight forward to use and Andrej does a really good job explaining the tuning parameters.

Results were pretty interesting.

Seed “JERRY”

JERRY: Hearing anyone amazing. (They both sit down, but on one.) DOCTOR: I explain the TV Marya Henungician. JERRY: I mean she put some guy down and stor it like that. Uh, could you get over the point? GEORGE: I think he's good, and find out worth me. GEORGE: No, no. GEORGE: (eating a TV, Newman spans the steps.) DARRYL: I have catched apartment roments again. It's just convanted. I forgot about the bus KEVIN: Now for your keys. HELEN: So, she’s thinking of a damn assumber!! JERRY: Wow, I have holded jokes. JOE: What are you gonna do? He's going to like that? (scene ends) \[setting: Jerry's Apartment\] (Jerry's car pets of George's trip, Allison Poppie's guest. Kramer tells Jerry he puts his head on.) PETERMAN: I'm a old man! Now, please? 7, no. ELAINE: George, what do you call it in the Wendy?" ELAINE: "...embhe.. JERRY: Hey, hey, what kind of rubber guy came down we have, chotge GEORGE: No yesale. JERRY: (Opens the door) Is it Tive Vemma.” so, how can I tell you? GEORGE: No Th supposed to be the stoundation. It's committee! No one will be a drop here. Talk like An idea. JERRY: Not been on it? HELEN: No, Mister Costanza, what do you mean, they were still an about forget the pilot. (Kramer walks over to George's sarcastical suit for the next bar. George goes with Manya) KRAMER: Well, I’m not taking this turkey now. \[Jerry's Apartment\] (I think I join us with her here slips where the corlandlas burns most of the gang. GEORGE: About it... (Difficults exit) JERRY: Ogh one of those feight, fish and out, I wasn't like, all they got a week, and that I got uh.. Aho. CLERK: I have no place struggle... (Talking with her broke gesture to George. He's got a wacket on the door.) GEORGE: Hi. No how were you? GEORGE: Police. She wanted a friend of the bus now. That's so nice for a tree but the bucket should be pretty now. JERRY: Why did you go out and I'd go? It was now, but then she keeps slept with a piano in the chicken

Seed “ELAINE”

ELAINE: George, how much did you know? I can't do this. GEORGE: So what did she think? JERRY: You know, much so much dishouse? FRANK: We got a little nuty in the building. Hey, the can's kneephap on it. Here we go. I'll put it on. It means so would it have done the steams. [Scene moves around desperate with sitting beside a handicap room watching theatro. All right and she's George and George in the next bar.] KRAMER: Others People hear problems, Just a little because he can work off tried clisic. (goes to motion) Wigness Get for are doing charatter? JERRY: (still not staying how putting your seats and George, getting on his shirt, with making back their hole.) KRAMER: Hey, ah! It's honest! GEORGE: Yight. JERRY: Oh, my god! FELDMAN: That’s all me to splat around the intercam on when you bit it? DOCTOR: . . . JERRY: I would love you. JERRY: They've met me again! JERRY: So you would be the ones with things of this is like a homeer overlightevies. (Jerry and Kramer grab on, George pulls his hand to the while.) What punk? JERRY: What's your day in the Prusor sold, so tell him why you want to leave? ELAINE: Look, How did you do that? NEWMAN: Oh, hi when what, I beat with you. Blood, min have sex, it would be not more. We found any party to meet her. CLERK: Maybe you can talk to him. ELAINE: Party? Dad, they could, and, unfortunately, the friend, I'm going to the New York Bookstore on the couch, sell your new couch. JERRY: Hated the doctor?!! (Clicks through his finger back) KRAMER: Well, I mean, I told you!...uh... Could you dump up my mail test? BICKES: Ya.. (Kramer opens the door.) JERRY: Come on, of course. I'm going to be fun. KRAMER: Yeah. JERRY: Yeah... KRAMER: You got a thing? Mailragh... Paul? [Jerry and George at Dleas and Jerry's apartment] Notice: "THE TEACHER MOUTH AT, THE CULATS THE THE PASTERING TURCING MACHINE, GEORGE tHEBERBS CAR AND THE SCENE – DOING INCORTES GEORGE's BOHT AND HAS GOT ON OFFICE INSIDE CORTIAND AIRING FOR. INT.

Seed “KRAMER”
KRAMER: Chapper apple. All right okay. I can't believe it. I don't think anyone wish me. GEORGE: All right, then no little degrees. KRAMER: Hello, Mr. Stranger. ELAINE: What time is it? KRAMER: Oh, Jerry, what am I gonna do? KRAMER: (disgusted) That's not your line. That’s the - why did you be some kind of short? DENISE: No, no, I'm sorry of course this can make me join spot on you. GEORGE: Please, respect, you know, rubbing little sense. Can you tell me that I can borrow it? JERRY: Would you know what the thing is? What are you doing here? GEORGE: Good for you when I was too writing uh zunk that can. (Newman hangs up) KRAMER: Yea you know, what shouldn't I do? JERRY: Jerry, I'm on the chair. Mother's doesn't come back. JERRY: Oh, no. Would you do me a favour? MORTY: Kramer JERRY: I saw Herbans and Mary Anne, for Lena? JERRY: Not from Vovan. Outta the meal, she ofceced this guy. A bunkie liet with some bananas. I gotta get them any good exvocton for face store company. JERRY: He turned me on in? ELAINE: I, uh...petulaction... SUSAN: hot'd it go? KRAMER: Yeah, but George is thinking. ELAINE: I told you to see you. JERRY: I still say with us, very nice. I'm all agreed. Why is there all all this? I mean it's not here when you’re really there. GEORGE: I will, anything at the Alarike and Kxardittour Jerry. JERRY: People who use halition. GEORGE: Excuse me, you half is just here.. And why don't you pay him out of the hall? FATHER-PRIEST: Into Marisa Tomei. That's not me. JERRY: Stop it! Hair, don't worry, I've took my tacked. Everything is welcome against uh.. (Kramer presses the kitchen from his window, grabs Jerry and George.) JERRY: Sanly Just centals! Don't you see?" JERRY: What, are you through? KRAMER: (pointing) Oh. (They make back posters With the distraction as they're dry) GEORGE: This is March. JERRY: Take his phone here! Go ahead. ELAINE: Who says to him? KRAMER: I can't even make dinner. It's a fish. I want to tell ya where the feeling should get me together.

Seed “GEORGE”
GEORGE: Elaine, how much did you know? I can't do this. GEORGE: So what did she think? JERRY: You know, much so much dishouse? FRANK: We got a little nuty in the building. Hey, the can's kneephap on it. Here we go. I'll put it on. It means so would it have done the steams. [Scene moves around desperate with sitting beside a handicap room watching theatro. All right and she's George and George in the next bar.] KRAMER: Others People hear problems, Just a little because he can work off tried clisic. (goes to motion) Wigness Get for are doing charatter? JERRY: (still not staying how putting your seats and George, getting on his shirt, with making back their hole.) KRAMER: Hey, ah! It's honest! GEORGE: Yight. JERRY: Oh, my god! FELDMAN: That’s all me to splat around the intercam on when you bit it? DOCTOR: . . . JERRY: I would love you. JERRY: They've met me again! JERRY: So you would be the ones with things of this is like a homeer overlightevies. (Jerry and Kramer grab on, George pulls his hand to the while.) What punk? JERRY: What's your day in the Prusor sold, so tell him why you want to leave? ELAINE: Look, How did you do that? NEWMAN: Oh, hi when what, I beat with you. Blood, min have sex, it would be not more. We found any party to meet her. CLERK: Maybe you can talk to him. ELAINE: Party? Dad, they could, and, unfortunately, the friend, I'm going to the New York Bookstore on the couch, sell your new couch. JERRY: Hated the doctor?!! (Clicks through his finger back) KRAMER: Well, I mean, I told you!...uh... Could you dump up my mail test? BICKES: Ya.. (Kramer opens the door.) JERRY: Come on, of course. I'm going to be fun. KRAMER: Yeah. JERRY: Yeah... KRAMER: You got a thing? Mailragh... Paul? [Jerry and George at Dleas and Jerry's apartment] Notice: "THE TEACHER MOUTH AT, THE CULATS THE THE PASTERING TURCING MACHINE, GEORGE tHEBERBS CAR AND THE SCENE – DOING INCORTES GEORGE's BOHT AND HAS GOT ON OFFICE INSIDE CORTIAND AIRING FOR. INT.

Pretty interesting results given the fact that the model works at character level without knowing any english grammar rules!

Training params I used on 4mb of Seinfeld scripts
th train.lua -data_dir data/seinfeld -rnn_size 700 -num_layers 3 -dropout 0.5 -batch_size 40 -seq_length 40