Ik wil eens kijken of ik op basis van zo'n model automatisch filmscripts zou kunnen genereren. Hoewel Bert erg goed in diverse NLP taken voor de dag komt zou GPT-2 veel beter zijn in het generen van nieuwe teksten.
GPT-2 is een model ontwikkeld door OpenAI, het initiatief van o.a. Elon Musk om kunstmatige intelligentie ontwikkelingen vrij te geven. In tegenstelling tot dit uitgangspunt is gpt-2 juist niet vrijgegeven omdat het zo goed zou zijn in het genereren van tekst dat het te makkelijk misbruikt kan worden voor fake news etc.
Maar gelukkig zijn kleine varianten wel vrijgegeven en nagebouwd.
Al snel vind ik een variant die ook trainbaar is op eigen teksten.
https://github.com/nshepperd/gpt-2
@article{radford2019language,
title={Language Models are Unsupervised Multitask Learners},
author={Radford, Alec and Wu, Jeff and Child, Rewon and Luan, David and Amodei, Dario and Sutskever, Ilya},
year={2019}
}
Eerst maar eens even wat filmscripts zien te downloaden.Eerst probeer ik dat uit 'www.dailyscript.com' maar daar zijn de scripts. door elkaar, in html, pdf, text of zelfs als afbeeldingen opgeslagen. Het lukt uiteindelijk redelijk maar al snel kom ik ook de 'imsdb' site tegen waar de scripts een geijkvormiger format hebben. Het lukt mij uiteindelijk om 1097 filmscripts in te laden en naar een bruikbaar format om te zetten.
Na wat experimenteren krijg ik ook de training module aan de praat. Het model is het 'kleine gpt-2' model met de naam '117M'.
Per 100 epochs spuugt hij er een voorbeeld uit. Na 1800 epochs bijvoorbeeld:
Generating samples...
======== SAMPLE 1 ========
"I've been waiting for four months..."
The camera zoomed in on Summer and she smiles at it. Then she goes on,
"We still don't have money. We just don't know what to do with it
and we're desperate - and we... we want it!"
It's the kind of gushing sound Summer makes when she's got
something to say to this whole mess. Summer laughs it off.
(102)
INT. HOSPITAL - LATER
Adrian and Summer enter the hospital. It's bright, hot summer. Everything is
clear. Everything. Summer and Adrian. We see them waiting
for all this to happen and nothing. We can only feel uneasy.
ADRIAN
Summer... you're doing just fine. I mean I
just don't know what to do with you...
Summer... tell him... tell his story.Tell...
this story.
(114)
ADRIAN
All I know is... I don't have the money
... I need someone else - someone to take
my place.
(89)
INT. BRIDGE/AMERICAN SHIP - EVENING
Adrian is in the Brat Ward office. He starts typing furiously.
ADRIAN
Hello... Adrian... what are you doing?
He looks at Summer. He smiles at him.
ADRIAN
(SEMPLATE)
Hello. What are you reading?
ADRIAN (CONT'D)
... Why... I'm sorry. I want your stories.
SUMMER
(SUMMER'S TEMPLE)
I haveafact. I've just never heard
anything like it before. They're all
too funny...
Adrian is likeabeat into Summer's head, as if to say "You
know what I love the most? The smile. That
is likeacry. Tell me.
ADRIAN
(SHOUTING)
That's what I love. That's who I am.
SUMMER
(SHOUTING)
... What?
ADRIAN
(BEAT)
And now it's time. You know what I think?
SUMMER
(REPLACEMENT)
I think all I need to do is say
the truth.
ADRIAN (CONT'D)
You know what I mean? It's not easy
forashiny-ass man to say the
truth. That's the way it's always
used. Don't hold it against me.
The camera goes back to the report, showing the brat's
picture on the wall.
(115)
INT. ADRIAN'S OFFICE/AMERICAN SHIP - EVENING
Adrian opensadress. He sees Summer, the brat, walking down the
tiled hallway. She smiles.
ADRIAN (CONT'D)
Sorry if I've been... awkward this week.
ADRIAN
(SHOUTING)
I'm really sorry.
ADRIAN
(SNAPS)
Summer, are you sure you're notafucking late?
(116)
ADRIAN
(SNAPS)
Yeah, exactly...
ADRIAN
You're not really late!
The door opens and Summer enters through it. Adrian sees her
laughing.
(117)
ADRIAN
(BEAT)
Summer?
ADRIAN
... Excuse me?
A hand caresses Adrian's face.
ADRIAN
(SNAPS)
Oh, I'm sorry. You should probably go
back to that room.
Adrian nods. He's done talking now. They walk back to
another office. It's closed - Adrian's face is blank.
ADRIAN (CONT'D)
I know I did not mean that way.
Summer goes in foravout. The head is covered in beads of
healing. It's like she's coming back from a
life long battle with cancer. Adrian's words are likeah
andah - like the best part of love is
nowhere near close. He throws the book away. It's
under the desk. He looks at it hard in the eyes.
ADRIAN (CONT'D)
... And what?
ADRIAN
I know it took me about two weeks, but
all I want is some rest, some rest for...
...when I'm going to die. I want to
get some rest.
Frosh is walking through the room.
Frosh
(SCREAMS)
Oh god, I'm so mad at you. The God
Savior must be dead...
Suddenly, the door clangs shut, revealing Adrian's face, his head
swallowing with emotion.
Dat ziet er al heel grappig uit volgens mij. Ik heb alleen de tekst een beetje aangepast aan een formeel script layout.
Een later voorbeeld (3100 epochs):
Generating samples...
======== SAMPLE 1 ========
impit,
it's fine. And you know what, Colin
is pretty pissed? 'Cause he's told
me this shit in the office --
CRITICAL. ISSUES
I'm not Colin. But if he wants to
convince me to drop the bomb,
shit, who am I to tell him.
Issei looks at Dwayne, hasafunny guess as to what he thinks.
ISSUES
Are you sure you don't want to be
the guy who bombs Pearl Harbor?
Snoop coughs, can't believe his luck.
(SOS)
Yeah, shit. He's never gonna argue
with you about his opinions on
war.
Pause.
SNOOP
Yeah. I think that's the point.
51 CONTINUED: (3) 51
Issei smiles.
SNOOP
It's not really like that.
Issei goes to talk to Hannah...
KATE
Hey.
KATE
Don't do this.
SNOOP
I don't think it's your thing.
We do have disagreements, Colin.
Issei goes back to talking to Hannah. Issei
goes to Laura. Laura takesisense to her worried face.
LAURA
(MAD)
Don't talk to him about it.
Laura goes back to her computer and she goes to look at
it. Laura leaves. Hannah goes to look at Laura's screen. Laura
makes no reply. Kate pulls out her cell phone and is surprised to
havehad it at her. She dialsav.copilot.
Hannah ignores her.
Hannah dialsav.copilot.
Hannah draws his gun.
Hannah fires. Laura flinches.
LAURA
You gotaclear?
INT. HANDA - BEDROOM - DAY
Silence. Laura looks at her phone. It doesn't answer. She
doesn't know what to do.
Laura gets up. Starts screaming.
LAV'AFEE VOLLEYball player pulls out his gun.
LAURA
Hold on back there...
The ball goes right through the hands of the Juicy
girl. Laura's in the grass trying to get it on.
She swings the ball home.
Kate yanks Laura's phone from her pocket. She yells at
her on the other end. Laura looks up as the cell phone cuts
off her account.
Kate looks at her watch.
52.
LAURA
(continuing)
Wait ... wait ... wait ...
Laura finally grins.
INT. HYDRAULIC CHAMBER - LATER
Laura's head is pressed up againstacoil as she repeatedly
dials in her lungs, gaining access to her organs. She
reaches out, tears begin to pool in every muscle in her body.
Atabele tumor covers the inside of her esophagus. Blood
continues to flow from her nose to her lungs.
Laura puts on weight. She throws herself likeababy.
Suddenly, two violent lungeions strike her.
Her right thumb piercesadiseally shaped piece of glass in the
sacral plexus, tearing apart its neck. She falls backward,
and lands on her back, bleeding heavily. Her head slams against
the pavement.
Laura grabs the back of her coat and puts it onabarper,
slamming the back cover over her mouth.
As she falls, an electric current shoots through her
face, sending her flying.
Laura looks up. She sees two more electric sparks and
the third flying through the window of her car, hitting Laura in
the leg. She screams.
Silence.
EXT. STAIRS - DAY
The sky is white, the sunsets are still distant, the waves
slowly turning the southern tip of Florida into Daytona.
INT. HOTEL - NIGHT
Laura stays completely still as she travels through her hotel
room, looking out over the city. She never lets that stop
her.
53.
INT. AIRPLANE - NIGHT
Laura makes her way down the aisle of her Air France.
A cab drives intoacarrier. As Laura checks the distress sign,
her face lights up.
THE CAB pulls intoastreet at the entrance to the hotel.
An attendant greets them bycalling their steward.
Carefully, Laura unlocks the front passenger side door and
opens the heavy doors. Inside, Laura enters her room,alittle frightened,
quiet.A cabin attendant greets her.
ALABAMA
The next morning Laura comes out of her room. She is six
months pregnant.
INT. HOUSING ROOM IN DUSAN PARK - DAY
Inside Anheuser's office building. Inabrammed room - wide
room with
Toch al veel beter dan mijn eigen werk :-)
Geen opmerkingen:
Een reactie posten