Het gpt-2 model werkt heel goed op Engels maar belabbert op Nederlands. Wellicht moet er een 'groot NL' corpus tegenaan worden gegooid. Dat is dan uiteraard wikipedia. Hier vind ik de Nederlandse dump: https://dumps.wikimedia.org/nlwiki/20191001/
Ik gebruik de wiki_dump_reader om de data om te zetten naar tekstbestanden. Uiteraard heb ik weer de inmiddels gebruikelijke uitdagingen om de tekst om te zetten van unicode naar ascii. Waarom is dat toch zo lastig? Zelfs de speciale modeule 'unicodedata' die ik hiervoor installeer blijkt nog steeds fouten op te leveren bij het wegschrijven naar een tekstbestand.
Dus maar weer de 'harde methode met een karakteromzettting met de beulpzame module 're'.
from wiki_dump_reader import Cleaner, iterate
import unicodedata
import re
file1 = open(r'C:\\Users\\DirkW\\Documents\\AJW2\\' + "WikiTextFile.txt",mode='w',encoding='utf-8')
# unicode to ascii converter
def unicode_to_ascii(s):
return ''.join(c for c in unicodedata.normalize('NFD', s)
if unicodedata.category(c) != 'Mn')
cleaner = Cleaner()
def preprocess_sentence(w):
w = unicode_to_ascii(w.strip())
#w = unicode_to_ascii(w.lower().strip())
# creating a space between a word and the punctuation following it
# eg: "he is a boy." => "he is a boy ."
# Reference:- https://stackoverflow.com/questions/3645931/python-padding-punctuation-with-white-spaces-keeping-punctuation
w = re.sub(r"([?.!,¿])", r" \1 ", w)
w = re.sub(r'[" "]+', " ", w)
# replacing everything with space except (a-z, A-Z, ".", "?", "!", ",")
w = re.sub(r"[^a-zA-Z?.!,¿]+", " ", w)
w = w.rstrip().strip()
'''
while w.find('. .')!= -1:
w = w.replace('. .','')
while w.find(' ')!= -1:
w = w.replace(' ',' ')
# adding a start and an end token to the sentence
# so that the model know when to start and stop predicting.
'''
w = w + ' <|endoftext|> '
return w
#for title, text in iterate('C:\\Users\\DirkW\\Documents\\AJW2\\nlwiki-20191001-pages-articles-multistream1.XML-P1P123351'):
i = 0
for title, text in iterate('C:\\Users\\DirkW\\Documents\\AJW2\\nlwiki-20191001-pages-articles-multistream.XML'):
text = cleaner.clean_text(text)
cleaned_text, _ = cleaner.build_links(text)
file1 = open(r'C:\\Users\\DirkW\\Documents\\AJW2\\Wiki\\' + "WikiTextFile" + str(i) + ".txt",mode='w',encoding='utf-8')
file1.write(preprocess_sentence(cleaned_text))
file1.close
i+=1
Ik maak hiermee allemaal losse wiki bestandjes van. 211.674 stuks (hij stopt met een error vanwege ruite gebrek. vermoedelijk maximaal aantal bestanden per folder?)
De teksten staan op 1 regel en worden afgesloten met '<|endoftext|>'
Ik laat het gpt-2 model een ruime 54.000 keer trainen. Hierbij gaat de gemiddelde 'loss' van rond de 3 (bij 10.000 epochs) naar rond de 2.50. Het lijkt nu niet heel veel beter meer te worden.
[10000 | 4285.37] loss=2.90 avg=2.97
[10001 | 4285.69] loss=3.12 avg=2.97
[10002 | 4286.01] loss=2.80 avg=2.97
[10003 | 4286.33] loss=2.97 avg=2.97
[10004 | 4286.64] loss=2.92 avg=2.97
[10005 | 4286.96] loss=3.42 avg=2.97
[10006 | 4287.27] loss=3.14 avg=2.97
[10007 | 4287.58] loss=3.24 avg=2.97
[52647 | 7822.63] loss=2.61 avg=2.51
[52648 | 7822.94] loss=3.07 avg=2.52
[52649 | 7823.24] loss=2.93 avg=2.52
[52650 | 7823.55] loss=2.29 avg=2.52
[52651 | 7823.86] loss=2.62 avg=2.52
Dan maar eens testen. Grappig genoeg lijkt hij Engels nog steeds best wel aardig te doen:
Model prompt >>> . i was trying to get it set up this morning and am running into an issue
======================================== SAMPLE 1 ========================================
on my pc Delete .... then i disable all the test emails you placedcase on adobe and then
======================================== SAMPLE 2 ========================================
when that happens i have this remote desktop connected straight from the command line rand resync sql excel <
======================================== SAMPLE 3 ========================================
because the dev team is unable to show all the fields . how can i turn off the settings ,
======================================== SAMPLE 4 ========================================
with a couple things . the install description lists it as south american and i would like to see
======================================== SAMPLE 5 ========================================
with cryptow can we all let in update to make it work ok ? when should i start m
================================================================================
Of
Model prompt >>> i was trying to get it set up this morning and am running into an issue
======================================== SAMPLE 1 ========================================
. do you know what this issue was ? med venlig hilsen best regards linesker rep
======================================== SAMPLE 2 ========================================
. i can read the see below . it is very unusual to receive bugs in files .sometimes called
======================================== SAMPLE 3 ========================================
with it or perhaps not met a few migrations ? and ooln , dit is epona
======================================== SAMPLE 4 ========================================
at the moment . it is still not working very well and i will either move to the next step
======================================== SAMPLE 5 ========================================
are those issue resolved ? other workday gigs are expected on b th and declare tomorrow ? case closed
================================================================================
Nederlands lijkt echter nog behoorlijk ver weg.
Model prompt >>> . beste marjan , heb je dit destijds nog kunnen testen ? ik vermoed dat het een ticket is die nog openstaat maar
======================================== SAMPLE 1 ========================================
die van betekenis komt voor . kun jij het scher
======================================== SAMPLE 2 ========================================
maandag enige tijd augustus beste marjan , is het mog
======================================== SAMPLE 3 ========================================
wellicht ook op jouw permissies in de website zoekt zit zo
======================================== SAMPLE 4 ========================================
op deze link moeten worden . dan heeft nog zelf en k
======================================== SAMPLE 5 ========================================
hij ziet dat een dekke kost voor een ticket is . groet
================================================================================
of
Model prompt >>> . beste marjan , heb je dit destijds nog kunnen testen ? ik vermoed dat het een ticket is die nog openstaat maar
======================================== SAMPLE 1 ========================================
ze het vertelde hij zo goed gedaan met eventueel nog kg .
======================================== SAMPLE 2 ========================================
opgesplitst voor de storing van de request wordt uiteindelijk ge
======================================== SAMPLE 3 ========================================
erkend is . anders kan ik neer een overeenkomst he
======================================== SAMPLE 4 ========================================
daar dus nog the ontvanger eine verplicht handigert over qu
======================================== SAMPLE 5 ========================================
maatregelen zichtbaar rondjamin zit . met vriendelij
================================================================================
Wellicht toch nog wat doortrainen of een keer van scratch proberen. Even een nachtje over slapen ...
dinsdag 15 oktober 2019
dinsdag 27 augustus 2019
Meer NLP for fun - 05 - Mail generator
Voor een eerder project heb ik al eens mijn mailbox geexporteerd. Leuk om eens te kijken hoe gpt-2 mailtjes kan genereren.
Het omzetten naar een tekstfile geeft weer de inmiddels gebruikelijke unicode errors maar al snel lukt het om de mails in een 35mB tekstbestand te krijgen.
Ik besluit het 'kleine' gpt-2 model te gebruiken om niet eindeloos op resultaten te moeten wachten.
Het is ongelofelijk hoe snel het pakket de structuur van mailtjes oppakt. Al bij de 500 e epoch zit die er goed in:
From: Wirtz, Dirk Willem
Sent: Tuesday, June 24, 2018 6:49 pm
To: John Deere >
Subject: CROP - Request of a new user
Hi Dirk Willem,
A
The request is pending approval, and this will prevent your request from being rejected. I have a plan for a CROP which the User has agreed to take up upon the Request.
Thanks,
Dirk Willem
Ik check of er delen zijn die 1 op 1 overgenomen zijn maar hij heeft echt de (bij)zinnen zelf bedacht. 'John Deere' komt 1 keer in mijn mail archief voor maar wellicht vaker in het bronmateriaal waar het oorspronkelijke gpt-2 model op is getraind.
Gaaf! Ik weet niet wanneer ik ga 'overfitten' maar ik laat het model nog zo'n 2900 keer doortrainen. Op een gegeven moment begint hij ook een beetje NL te kennen:
Hi Joost,
Dit kantal kunt ervoor ik bij de echt door van aub.
Hier is gevraagd om ontvangen naar het onze afgeving en zorg om dat het de kantal op de gebruikt dit een de nog bijvaldrijk om de verwachtingslogerent. Daar om dat is daar om zie nie auch over tijdens en die op ons komende aangegeven.
Dit voldoende jullie geschikt dat jij dat verwachten.
Kind regards / Cordialement / Met vriendelijke groeten
Dirk Willem Wonnink
Hoewel Engels duidelijk zijn moederstaal is :-)
From: Peters, Danny [mailto:Danny.Peters@philips.com ]
Sent: dinsdag 31 november 2018 08:09
To: Wonnink, Dirk Willem >
Cc: Wonnink, Dirk Willem >
Subject: RE: Blueheart PH - BNL - Status Scripts & Updates
Hello Dirk Willem,
Here we go. We had issues with status status scripts last night.
We were talking to Philips to verify status status scripts and get the correct status files.
Today a new issue was triggered.
Status status is a data set of scripts and updates for various markets. To ensure all scripts have the correct file system, we have used a new set-up called status status scripts of our own choosing.
Status status scripts can be set up in the Status tab as well. For each status status script, we had to create the new data. For example we have 2 script types, each with three status status types. For each script type we are giving different details:
File type : Status status file.txt file
Version : Status status date line.txt file
Service : Status status service.txt file
Date : Status status description date.txt file
Ok, nou eens kijken of ik zelf een feed kan ingeven. Ik maak daarvoor gebruik van de code op deze site: https://www.analyticsvidhya.com/blog/2019/07/openai-gpt2-text-generator-python/
Wel moet ik het model kopieren en de parameters in het bestand 'checkpoint' op de juiste wijze naar het model laten verwijzen. Na wat 'modderen' lukt dat al snel.
Eerst maar een proberen: "From: Dirk-Willem"
To: Allard, Rob van >
Cc:
Subject: RE: CYOSOM Stories
Jan and Chloe,
If your name is known to BH, I will react quickly to this mail.
BN Admin Portal Organiser,
Kind regards / Cordialement / Met vriendelijke groeten
Dirk Willem Wonnink
IT Business Partner PH & HS Markets Benelux
Grappig. (Rob van Allard bestaat niet in mijn mailbestand - Wel wat lege regels verwijderd om e.e.a. compact te houden)
Een 2e voorbeeld:
Sent: woensdag 30 november 2018 15:26
To: Wonnink, Dirk Willem
Cc: Wonnink, Dirk Willem
Subject: RE: Deadline requirements per project B+
Importance: high
Hi Stephanie,
As per upcoming IT negotiations:
Applicant: Congel-Rocht, Marco van
For each project (as per budget), we need to ask the project management team, which may have an immediate cost review, to select the optimal excel file uploaded (only controlled by the project Manager).
For availability ahead of the IT negotiations, we prefer to wait until after OCR R2 (October 2). (If you need software, please send us a call) Then expect 1-3 PO's.
Ook aardig, nietwaar? Lang leve het fake nieuws :-)
Dan eens een NL test: "dat gaat zeker mogelijk zijn"
wel voor Deze basings bij een biedt-shop. Bekelden niet mee voor gemaakt er Iakel.
und. een je het vergemeld op de Edelweiss.
Alsstaat middels van VB foodstellen uit helprachtmoen overzaken besproken?
volgens support te maken
Working warmly,
Pascal Blandau
Inventiele industriele de feu Enormende een redalert-kit email met telle onze social touch-up met naaturinnerwisseler worden.
Hmmm , minder succesvol. I probeer het met een stukje eerder gegenereerde tekst:
"This week our audio and visual team from Philips Healthcare France"
will help you to share the next steps to cooperation between Philips healthcare and the Verona experience, to present the reforms of the two SoRo PHPs, to check the markets' roles in the healthcare sector, and to discuss the progress against a number of regulatory obstacles.
The participants will share with you a summary of their efforts in the next week: https://dayvoice.com/event/1230191-veronous-philips-5800372018 https://dayvoices.outlook.com/dobe...
If you liked this, consider contributing before Christmas!
Zelfs de url's verzint hij erbij volgens mij. Iig staan ze niet in mijn mail bestand. Wow!
Het omzetten naar een tekstfile geeft weer de inmiddels gebruikelijke unicode errors maar al snel lukt het om de mails in een 35mB tekstbestand te krijgen.
Ik besluit het 'kleine' gpt-2 model te gebruiken om niet eindeloos op resultaten te moeten wachten.
Het is ongelofelijk hoe snel het pakket de structuur van mailtjes oppakt. Al bij de 500 e epoch zit die er goed in:
From: Wirtz, Dirk Willem
Sent: Tuesday, June 24, 2018 6:49 pm
To: John Deere >
Subject: CROP - Request of a new user
Hi Dirk Willem,
A
The request is pending approval, and this will prevent your request from being rejected. I have a plan for a CROP which the User has agreed to take up upon the Request.
Thanks,
Dirk Willem
Ik check of er delen zijn die 1 op 1 overgenomen zijn maar hij heeft echt de (bij)zinnen zelf bedacht. 'John Deere' komt 1 keer in mijn mail archief voor maar wellicht vaker in het bronmateriaal waar het oorspronkelijke gpt-2 model op is getraind.
Gaaf! Ik weet niet wanneer ik ga 'overfitten' maar ik laat het model nog zo'n 2900 keer doortrainen. Op een gegeven moment begint hij ook een beetje NL te kennen:
Hi Joost,
Dit kantal kunt ervoor ik bij de echt door van aub.
Hier is gevraagd om ontvangen naar het onze afgeving en zorg om dat het de kantal op de gebruikt dit een de nog bijvaldrijk om de verwachtingslogerent. Daar om dat is daar om zie nie auch over tijdens en die op ons komende aangegeven.
Dit voldoende jullie geschikt dat jij dat verwachten.
Kind regards / Cordialement / Met vriendelijke groeten
Dirk Willem Wonnink
From: Peters, Danny [mailto:Danny.Peters@philips.com ]
Sent: dinsdag 31 november 2018 08:09
To: Wonnink, Dirk Willem >
Cc: Wonnink, Dirk Willem >
Subject: RE: Blueheart PH - BNL - Status Scripts & Updates
Hello Dirk Willem,
Here we go. We had issues with status status scripts last night.
We were talking to Philips to verify status status scripts and get the correct status files.
Today a new issue was triggered.
Status status is a data set of scripts and updates for various markets. To ensure all scripts have the correct file system, we have used a new set-up called status status scripts of our own choosing.
Status status scripts can be set up in the Status tab as well. For each status status script, we had to create the new data. For example we have 2 script types, each with three status status types. For each script type we are giving different details:
File type : Status status file.txt file
Version : Status status date line.txt file
Service : Status status service.txt file
Date : Status status description date.txt file
Ok, nou eens kijken of ik zelf een feed kan ingeven. Ik maak daarvoor gebruik van de code op deze site: https://www.analyticsvidhya.com/blog/2019/07/openai-gpt2-text-generator-python/
Wel moet ik het model kopieren en de parameters in het bestand 'checkpoint' op de juiste wijze naar het model laten verwijzen. Na wat 'modderen' lukt dat al snel.
Eerst maar een proberen: "From: Dirk-Willem"
To: Allard, Rob van >
Cc:
Subject: RE: CYOSOM Stories
Jan and Chloe,
If your name is known to BH, I will react quickly to this mail.
BN Admin Portal Organiser,
Kind regards / Cordialement / Met vriendelijke groeten
Dirk Willem Wonnink
IT Business Partner PH & HS Markets Benelux
Grappig. (Rob van Allard bestaat niet in mijn mailbestand - Wel wat lege regels verwijderd om e.e.a. compact te houden)
Een 2e voorbeeld:
Sent: woensdag 30 november 2018 15:26
To: Wonnink, Dirk Willem
Cc: Wonnink, Dirk Willem
Subject: RE: Deadline requirements per project B+
Importance: high
Hi Stephanie,
As per upcoming IT negotiations:
Applicant: Congel-Rocht, Marco van
For each project (as per budget), we need to ask the project management team, which may have an immediate cost review, to select the optimal excel file uploaded (only controlled by the project Manager).
For availability ahead of the IT negotiations, we prefer to wait until after OCR R2 (October 2). (If you need software, please send us a call) Then expect 1-3 PO's.
Ook aardig, nietwaar? Lang leve het fake nieuws :-)
Dan eens een NL test: "dat gaat zeker mogelijk zijn"
wel voor Deze basings bij een biedt-shop. Bekelden niet mee voor gemaakt er Iakel.
und. een je het vergemeld op de Edelweiss.
Alsstaat middels van VB foodstellen uit helprachtmoen overzaken besproken?
volgens support te maken
Working warmly,
Pascal Blandau
Inventiele industriele de feu Enormende een redalert-kit email met telle onze social touch-up met naaturinnerwisseler worden.
Hmmm , minder succesvol. I probeer het met een stukje eerder gegenereerde tekst:
"This week our audio and visual team from Philips Healthcare France"
will help you to share the next steps to cooperation between Philips healthcare and the Verona experience, to present the reforms of the two SoRo PHPs, to check the markets' roles in the healthcare sector, and to discuss the progress against a number of regulatory obstacles.
The participants will share with you a summary of their efforts in the next week: https://dayvoice.com/event/1230191-veronous-philips-5800372018 https://dayvoices.outlook.com/dobe...
If you liked this, consider contributing before Christmas!
Zelfs de url's verzint hij erbij volgens mij. Iig staan ze niet in mijn mail bestand. Wow!
Verona experience? |
zondag 25 augustus 2019
Meer NLP for fun - 04 Testen met NL wetteksten
Gpt-2 is, naar verwachting, met name getest op Engelstalige (curated) Reddit paginas, die de makers verzmeld hebben en 'WebText' hebben genoemd. Ze hebben veel aandacht besteed aan de kwaliteit van de informatie en hebben uiteindelijk 8 miljoen (40gB) aan tekst verzameld.
Het aanleren van de filmscripts lijkt aardig te lukken hoewel de leersnelheid bij het 117M model vele malen hoger is dan bij het 345M model. De kwaliteit lijkt ook beter. Met name de normale scriptstructuren worden veel sneller gerealiseerd. Het is moeilijk te zeggen in welke mate overschakeling van Adam naar SGD en de aanpassing van de leercoeficient daat schuldig ana is. Maar helaas kan ik het veel groter 345M model niet anders op mijn pc draaien.
Voor de aardigheid test ik het model eens met Nederlandse teksten. Ik heb ooit de Nederlands burgelijk wetboeken geladen en die gebruik ik nu als input. (6mB tekst).
Tot mijn grote verrassing leert het 117M model al na enkele epochs, heel snel de structuur van NL en ook de structuur van wetboekbepalingen in het algemeen. Het lijkt of de kennis van Nederlands toch op een of andere wijze al 'ingebakken' zit. Of wellicht een soort algemeen taalbegrip.
Eerst combineert hij de artikelstructuur met een mix van Engels en een beetje NL maar al snel probeert hij heel aardige vol NL zinnen te genereren. Bijvoorbeeld:
Artikel 8
1. Een verpalen van de bevoegdheid met zijn verband voorzeld naar dien van een verpalen niet zijn toepassen en voorzoek met zijdstelling van de inzettelig is verleiden uit de rechtschap en niet uit de voldaan is bestaan voorzeld of verplochtingen gelegd, in de vermachten als bedoeld in de vermeld voor zijn verplicht, en alleen in de zijn verplicht, ander de vermoord op de rechtschap voorzeld of verplichtingen en alleen in artikelen 4 van der rechtersbevrinnen het verplicht te verplicht, bevindt in artikel 6 of Nederlandse vanderen bepaald en bevoegdheid.
2. De voldaanen uit een verpalen van de bevoegdheid van het verplicht te verplicht kan gerechtigde verstaan of de zijn tot het voldaanen verleiding.
Artikel 9
1. Op de kouden van der bij de bevoegdheid zijst die en rechtsmiddel tot grond van de aanlijk bevel en bedoeld in de vermachte van de voortvloecht na of vermacht is bepaalde in gedachtlijkheid ...
Dat werkt gaaf! En omdat het NL is is de kwaliteit net iets makkelijker te beoordelen dan het Engels. Daar denk je toch bij elke verschrijving of het wellicht een minder bekend Engels woord is.
Hoe zou het 345M model het doen?
Daar merk je ook weer dat het enorm veel langzamer leert. De learningrate van 0.0006 heb ik als advies bij gebruik van sgd van een site overgenomen.
Even, bij 9000 epochs, lijkt het model te denken dat het met Duits te maken heeft:
Artikel 765 (EU)
Oder die bestregerd terstelst du gestere artikel 755 bewaardt. Lade Bove verpaalds artikel 575, 576 daarischte die bepapennende auch bescheid worden, die dein artikel 695 die nach bepapennende worden als bepappen auch gestere a-d zum worden, artikel 745 daarischte die bepapennende auch bescheid worden, daarischte bepaalde worden als bepappen auf die gesteten, doch zu gewunden hin, daarischte betracht nach verstelten is ein achtigt gegeben, daarischte daarischte die gestere worden gegeben. In den zweisen achtigt of der gesteten of die gesteten of die gesteres in gereisen achtigt of die gesteres in gereisen afder die gesteres nach eine gesteres bepappen.
Maar vanaf zo'n 20000 epochs (gelukkig gaan ze vrij snel - een kleine seconde per epoch) lijkt het overwegend NL te worden. De structuur wordt nu ook meestal herkent en er worden steeds meer correct NL woorden gegenereerd:
3. Bijzewijs die verwachter van de rechten van zinige.
Doming hebben de eigen van woonstigheid van verwachter
4. De aanfagn wijs de verwachter zijn zijn zijl van de aanfagn in
communietatie van overeenkomst te bepaalde uit de rechten van zinige, in deze staat de bepaling, een vraag verzorgen.
Artikel 16 van het opdracht
1. Een aanfagn is of ten verplicht van het opdracht gegrond,
2. Bijzewijs die verwachter van de uitspraak is van het opdracht gegrond,
3. Het verweiging de staat van het opdracht waarvan bijzewijs of zien zake een van geestraadsbijen en de betrekking kan worden,
4. Het bevoegd het beding van de rechter bedrag van de werk,
5. Het het bevoegd zijn die die van de aanfagn van het opdracht gekomen,
6. Het bevoegd de vordering van de bevoden van een bevoegd van het bevoegd geen vragt.
Het gaat langzaam. Hier een aardig resultaat na 50.000 epochs:
Artikel 712
1. De griffierechten niet uit een van de dag of de bedrag tegen de vordering een verklaren, dan zou niet als bedoeld in het geschiedingen van de dag en als bedoeld in het geschiedingen van de dag, bedeutet, waarbij de griffierechten en of het bevelen.
2. De griffierechten niet voldoet de dag op bedoeld in het geschiedingen van de dag is voodt van de verzetting van gebruik, het onderzoek ken de griffierechten die in een bedrijf die en kennis als bedroedening op grond van de griffierechten, bedoeld in het geschiedingen van de dag, bedeutet, waarbij de griffierechten te bepalen, dan wel een bedrijf, dienst te zich niet is.
3. Voor zover het griffierechten kan de verzetting van grond van de bevelen, als bedoeld in het geschiedingen van de dag op de griffierechten, bedoeld in het geschiedingen van de dag, bedeutet, waarbij de griffierechten van de verzening tot grond van de griffierechten bedoelde bedrijf, dan wel te bepalen als bedroedening op grond van de griffierechten heeft, bedoeld in geval van de verzetting tot grond van de griffierechten bedoelde bedrijf.
Artikel 713
1. De griffierechten op bevelen te schade van de bevelen voor de griffierechten heeft als bedroedening, bedeutet, waarbij de griffierechten tot een verzetting bedroedigt te verzoeken op het griffierechten, bedoeld in het geschiedingen van de dificult, bedoeld in het geschiedingen van de dificult, bedeutet, waarbij de griffierechten te bepalen, dan wel te bepalen, bedoeld in artikel 7, bedoeld in het geschiedingen van de griffierechten, bedoeld in het geschiedingen van de griffierechten, bedeutet, waarbij de griffierechten als bedroeding tot een verzoeken tot lid van de griffierechten.
2. De griffierechten in het geschiedingen van de griffierechten met een bedroedig
Er blijven echter Duits-achtige (bedeutet) en vreemde woorden (bedroeiing) in voorkomen. Hier een resultaat na 60.000 epochs:
Sectb. 12. Verheuten
Artikel 1301
1. De schuldige in het verklaring van een houderen op verzoek van het verhaal van het in artikel 1201, eerste lid, van de Raade.
2. Houderen kan de straffe niet vermee heeft bepaalde, hetzij de straffe komen, dan een verplichtingen dat de straffe als andere het verhaal.
3. Volledige verheuten wordt aan de straffe in het deze verhouderen.
Artikel 1302
1. De schuldige in het verklaring van een houderen op verzoek van het in artikel 1202, de verplichting en beslissing, als hetzij de straffe in het verhouderen, een verplichtingen deze komen, op het verhaal kan kantonverwijld het schuldigheid met het bevoegd een schuldigheid met te zonder voldoop worden. Een gesloten daarvan verhouderen worden verschuldigd. Deze geplaat het gesloten daarvan heeft met zijn verhaal.
2. Volledige verheuten wordt aan de schuldigheid en het schuldigheid met het in artikel 1301, de verplichting en beslissing, onder a, onder b en onder d en derde niet met betrekking tot verhouderen aan de schuldigheid in het verklaring van een houderen op verzoek van het in artikel 1202, tegen de verplichting. Deze geplaat het geshet zij dien verhouderen worden verschuldigd. Als de straffe wordt in artikel 2102, aanhouden tot verhouderen als bij het wie zijn bevoegde toepassing. Als hetzij de staat als houdenaar geschaal heeft bestaat.
3. Titel aan wie ontwikkelvijke het schuldigheid, beroepen te vergoeding en beroepen te vergoeding in een ontvangen daarvan die tegen de verplichting en beslissing verweerd en verhouderen die tijd dat de schuldige aan de schuldigheid in de het
Het aanleren van de filmscripts lijkt aardig te lukken hoewel de leersnelheid bij het 117M model vele malen hoger is dan bij het 345M model. De kwaliteit lijkt ook beter. Met name de normale scriptstructuren worden veel sneller gerealiseerd. Het is moeilijk te zeggen in welke mate overschakeling van Adam naar SGD en de aanpassing van de leercoeficient daat schuldig ana is. Maar helaas kan ik het veel groter 345M model niet anders op mijn pc draaien.
Voor de aardigheid test ik het model eens met Nederlandse teksten. Ik heb ooit de Nederlands burgelijk wetboeken geladen en die gebruik ik nu als input. (6mB tekst).
Tot mijn grote verrassing leert het 117M model al na enkele epochs, heel snel de structuur van NL en ook de structuur van wetboekbepalingen in het algemeen. Het lijkt of de kennis van Nederlands toch op een of andere wijze al 'ingebakken' zit. Of wellicht een soort algemeen taalbegrip.
Eerst combineert hij de artikelstructuur met een mix van Engels en een beetje NL maar al snel probeert hij heel aardige vol NL zinnen te genereren. Bijvoorbeeld:
Artikel 8
1. Een verpalen van de bevoegdheid met zijn verband voorzeld naar dien van een verpalen niet zijn toepassen en voorzoek met zijdstelling van de inzettelig is verleiden uit de rechtschap en niet uit de voldaan is bestaan voorzeld of verplochtingen gelegd, in de vermachten als bedoeld in de vermeld voor zijn verplicht, en alleen in de zijn verplicht, ander de vermoord op de rechtschap voorzeld of verplichtingen en alleen in artikelen 4 van der rechtersbevrinnen het verplicht te verplicht, bevindt in artikel 6 of Nederlandse vanderen bepaald en bevoegdheid.
2. De voldaanen uit een verpalen van de bevoegdheid van het verplicht te verplicht kan gerechtigde verstaan of de zijn tot het voldaanen verleiding.
Artikel 9
1. Op de kouden van der bij de bevoegdheid zijst die en rechtsmiddel tot grond van de aanlijk bevel en bedoeld in de vermachte van de voortvloecht na of vermacht is bepaalde in gedachtlijkheid ...
Dat werkt gaaf! En omdat het NL is is de kwaliteit net iets makkelijker te beoordelen dan het Engels. Daar denk je toch bij elke verschrijving of het wellicht een minder bekend Engels woord is.
Hoe zou het 345M model het doen?
Daar merk je ook weer dat het enorm veel langzamer leert. De learningrate van 0.0006 heb ik als advies bij gebruik van sgd van een site overgenomen.
Even, bij 9000 epochs, lijkt het model te denken dat het met Duits te maken heeft:
Artikel 765 (EU)
Oder die bestregerd terstelst du gestere artikel 755 bewaardt. Lade Bove verpaalds artikel 575, 576 daarischte die bepapennende auch bescheid worden, die dein artikel 695 die nach bepapennende worden als bepappen auch gestere a-d zum worden, artikel 745 daarischte die bepapennende auch bescheid worden, daarischte bepaalde worden als bepappen auf die gesteten, doch zu gewunden hin, daarischte betracht nach verstelten is ein achtigt gegeben, daarischte daarischte die gestere worden gegeben. In den zweisen achtigt of der gesteten of die gesteten of die gesteres in gereisen achtigt of die gesteres in gereisen afder die gesteres nach eine gesteres bepappen.
Maar vanaf zo'n 20000 epochs (gelukkig gaan ze vrij snel - een kleine seconde per epoch) lijkt het overwegend NL te worden. De structuur wordt nu ook meestal herkent en er worden steeds meer correct NL woorden gegenereerd:
3. Bijzewijs die verwachter van de rechten van zinige.
Doming hebben de eigen van woonstigheid van verwachter
4. De aanfagn wijs de verwachter zijn zijn zijl van de aanfagn in
communietatie van overeenkomst te bepaalde uit de rechten van zinige, in deze staat de bepaling, een vraag verzorgen.
Artikel 16 van het opdracht
1. Een aanfagn is of ten verplicht van het opdracht gegrond,
2. Bijzewijs die verwachter van de uitspraak is van het opdracht gegrond,
3. Het verweiging de staat van het opdracht waarvan bijzewijs of zien zake een van geestraadsbijen en de betrekking kan worden,
4. Het bevoegd het beding van de rechter bedrag van de werk,
5. Het het bevoegd zijn die die van de aanfagn van het opdracht gekomen,
6. Het bevoegd de vordering van de bevoden van een bevoegd van het bevoegd geen vragt.
Kijken of doortrainen tot veel beter resultaten kan leiden.
Het gaat langzaam. Hier een aardig resultaat na 50.000 epochs:
Artikel 712
1. De griffierechten niet uit een van de dag of de bedrag tegen de vordering een verklaren, dan zou niet als bedoeld in het geschiedingen van de dag en als bedoeld in het geschiedingen van de dag, bedeutet, waarbij de griffierechten en of het bevelen.
2. De griffierechten niet voldoet de dag op bedoeld in het geschiedingen van de dag is voodt van de verzetting van gebruik, het onderzoek ken de griffierechten die in een bedrijf die en kennis als bedroedening op grond van de griffierechten, bedoeld in het geschiedingen van de dag, bedeutet, waarbij de griffierechten te bepalen, dan wel een bedrijf, dienst te zich niet is.
3. Voor zover het griffierechten kan de verzetting van grond van de bevelen, als bedoeld in het geschiedingen van de dag op de griffierechten, bedoeld in het geschiedingen van de dag, bedeutet, waarbij de griffierechten van de verzening tot grond van de griffierechten bedoelde bedrijf, dan wel te bepalen als bedroedening op grond van de griffierechten heeft, bedoeld in geval van de verzetting tot grond van de griffierechten bedoelde bedrijf.
Artikel 713
1. De griffierechten op bevelen te schade van de bevelen voor de griffierechten heeft als bedroedening, bedeutet, waarbij de griffierechten tot een verzetting bedroedigt te verzoeken op het griffierechten, bedoeld in het geschiedingen van de dificult, bedoeld in het geschiedingen van de dificult, bedeutet, waarbij de griffierechten te bepalen, dan wel te bepalen, bedoeld in artikel 7, bedoeld in het geschiedingen van de griffierechten, bedoeld in het geschiedingen van de griffierechten, bedeutet, waarbij de griffierechten als bedroeding tot een verzoeken tot lid van de griffierechten.
2. De griffierechten in het geschiedingen van de griffierechten met een bedroedig
Sectb. 12. Verheuten
Artikel 1301
1. De schuldige in het verklaring van een houderen op verzoek van het verhaal van het in artikel 1201, eerste lid, van de Raade.
2. Houderen kan de straffe niet vermee heeft bepaalde, hetzij de straffe komen, dan een verplichtingen dat de straffe als andere het verhaal.
3. Volledige verheuten wordt aan de straffe in het deze verhouderen.
Artikel 1302
1. De schuldige in het verklaring van een houderen op verzoek van het in artikel 1202, de verplichting en beslissing, als hetzij de straffe in het verhouderen, een verplichtingen deze komen, op het verhaal kan kantonverwijld het schuldigheid met het bevoegd een schuldigheid met te zonder voldoop worden. Een gesloten daarvan verhouderen worden verschuldigd. Deze geplaat het gesloten daarvan heeft met zijn verhaal.
2. Volledige verheuten wordt aan de schuldigheid en het schuldigheid met het in artikel 1301, de verplichting en beslissing, onder a, onder b en onder d en derde niet met betrekking tot verhouderen aan de schuldigheid in het verklaring van een houderen op verzoek van het in artikel 1202, tegen de verplichting. Deze geplaat het geshet zij dien verhouderen worden verschuldigd. Als de straffe wordt in artikel 2102, aanhouden tot verhouderen als bij het wie zijn bevoegde toepassing. Als hetzij de staat als houdenaar geschaal heeft bestaat.
3. Titel aan wie ontwikkelvijke het schuldigheid, beroepen te vergoeding en beroepen te vergoeding in een ontvangen daarvan die tegen de verplichting en beslissing verweerd en verhouderen die tijd dat de schuldige aan de schuldigheid in de het
Blijkbaar is 'houderen / houdenaar' een woord dat we zeker in de NL moeten opnemen :-) Synomiem met 'bezitten oid? Ook in de omliggende resultaten worden leuke nieuwe begrippen geoppert, bijvoorbeeld:
- schuldeeder
- rechtergevangt
- rechtsvrijding - wellicht een echt woord? Kan het niet op Google terugvinden
- vervuigheid
- tijdstipen / tijdstipene
Ik stop maar met trainen bij 62.200 epochs. Ik zie te weinig verbeteringen. Misschien nog eens een keer even proberen met een hogere learning rate.
Hier een voorbeeld van de parameter output:
[62800 | 698.25] loss=2.30 avg=2.15
[62801 | 699.16] loss=2.30 avg=2.15
[62802 | 700.06] loss=2.05 avg=2.15
[62803 | 700.97] loss=1.99 avg=2.15
[62804 | 701.87] loss=1.64 avg=2.14
[62805 | 702.80] loss=1.75 avg=2.14
[62806 | 703.73] loss=2.22 avg=2.14
Hier een voorbeeld van de parameter output:
[62800 | 698.25] loss=2.30 avg=2.15
[62801 | 699.16] loss=2.30 avg=2.15
[62802 | 700.06] loss=2.05 avg=2.15
[62803 | 700.97] loss=1.99 avg=2.15
[62804 | 701.87] loss=1.64 avg=2.14
[62805 | 702.80] loss=1.75 avg=2.14
[62806 | 703.73] loss=2.22 avg=2.14
Enkele dagen gelden is een nog grotere versie van het model vrijgegeven: Het 774M (762M?) model. Zal ik wel niet kunnen runnen helaas :-(
zondag 18 augustus 2019
Meer NLP for fun - 03 - Testen filmscripts met 345M model
Het is mij nu ook gelukt om het grotere model aan de praat te krijgen. Het model heet, in plaats van 117M, nu 345M. Volgens mij naar het aantal te trainen parameters. Ik heb, om geen memory errors te krijgen, daarvoor de optimizer van 'adam' naar 'sgd' gezet (Ergens las ik dat advies. Blijkbaar neemt Adam meer ruimte in) en daarnaast een parameter 'memory_saving_gradients' op True gezet.
Het model lijkt (veel?) langzamer door te krijgen dat het nu om filmscripts gaat. Ook traint het logischerwijs langzamer. De teksten zien er wel heel geloofwaardig uit. Helaas kan ik ze niet vergelijken met de originele input. Pas als het weer op scripts gaat lijken kan ik kijken of er wat logica van de bron in is terug te vinden. Hier een voorbeeld na 2500 epochs:
Generating samples...
======== SAMPLE 1 ========
his work, this isn't something to be taken lightly. This video doesn't represent an opinion. This work has not been endorsed by the Bitcoin Forum. It's just for fun. _______________________________________________ Bitcoin-development mailing list Bitcoin-development at lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-development<|endoftext|>A group calling itself "The League of Independent Scientists" is taking action against the University of Waterloo's faculty over what they say is unfair treatment of science faculty, and the impact the university's new tenure system would have on the province.
The professors are demanding that universities take away the privileges granted to professors at public or private universities and hand them over to individuals at universities with more conservative policies and values.
In a letter to the university president, one of the authors of the letter said University of Waterloo administration has tried to use the tenure system to harass those who seek to advance scientific knowledge. "We need you to reconsider your stance on those who do not support the university's belief about what is right for the state and what is right for society," said the letter, which was signed by 23 University of Waterloo and McMaster professors. "Your policy is an attack on science and the scientific process and should be changed by your leadership."
Some faculty are already considering leaving the province.
Story continues below advertisement
Dr. Robert E. O'Dell is chair of geography for the University of Regina and is considering leaving. "I'm pretty sure it's in the best interest to be the last person to retire in either of those two faculties. I'm not certain that either faculty are going to be able to do that. Either one is going to be much, much harder to replace. I think we need someone to step up and step in and fill the void," he said.
It is one of the demands of the group, in which only six professors and five students are involved.
The group hopes the government and Ontario will join the debate on scientific tenure and the tenure system.<|endoftext|>In the months since I wrote my first novel, the world of The Girl in the Red Hat had been shifting and shifting in my hands. For more than five years, I'd tried to keep it as consistent as possible. I had created a world where people who knew their work had been on screen for 15 years, never once felt like their identity as that work was questioned, only as we, onscreen, played the role of those that lived the reality of their work. And I had written that world. But in the midst of all the drama and drama, I didn't try to do as well as an artist on the small canvas I'd built. So, I went to the best writers I could find: the ones that were already working on big projects, or that I loved to read in the first place.
And for years, I tried to do the same.
I'm not alone.
One of the things I love about being a writer is that you can spend so much time on that page in your mind, in the first draft, or in the final edited word, that you'll never get to touch it. But it's really really important for you as a writer. Because as I was going to go to the writer's room, and my thoughts were going to drift from one paragraph to the next, and my thoughts would turn to the next writer, and my thoughts would turn to the next novel, and I'd get lost all the same. And I spent so much time thinking about those drafts. Some days, I thought for hours, some weeks. And all that time I got the best material. And that was all I got. But there are always other moments.
This is where I start thinking about the fact that there are other moments that are better. Some of them I never knew.
There are moments for me to get lost in.
There are minutes to watch the movie "The Godfather" and still not fully have what it takes to be the mobster we wanted to be the mafia we wanted to be. There are moments that are better to watch than those scenes where I just get lost in the world, and then have to wait until the next day or the next week or the next four days.
There are moments that I think, I will never achieve, because of those moments.
And I want to share some of those moments, because there are these moments, not every time, but there are times where I'm not sure if I'm going to be able to reach for them.
These moments, for me, are the moments when I know I will never be able to do what I want, because there isn't enough of this one thing that gives them meaning.
I don't have answers. What I have is this one thing, and I feel like I have no choice in the end.
One of the things I
Het model lijkt (veel?) langzamer door te krijgen dat het nu om filmscripts gaat. Ook traint het logischerwijs langzamer. De teksten zien er wel heel geloofwaardig uit. Helaas kan ik ze niet vergelijken met de originele input. Pas als het weer op scripts gaat lijken kan ik kijken of er wat logica van de bron in is terug te vinden. Hier een voorbeeld na 2500 epochs:
Generating samples...
======== SAMPLE 1 ========
his work, this isn't something to be taken lightly. This video doesn't represent an opinion. This work has not been endorsed by the Bitcoin Forum. It's just for fun. _______________________________________________ Bitcoin-development mailing list Bitcoin-development at lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-development<|endoftext|>A group calling itself "The League of Independent Scientists" is taking action against the University of Waterloo's faculty over what they say is unfair treatment of science faculty, and the impact the university's new tenure system would have on the province.
The professors are demanding that universities take away the privileges granted to professors at public or private universities and hand them over to individuals at universities with more conservative policies and values.
In a letter to the university president, one of the authors of the letter said University of Waterloo administration has tried to use the tenure system to harass those who seek to advance scientific knowledge. "We need you to reconsider your stance on those who do not support the university's belief about what is right for the state and what is right for society," said the letter, which was signed by 23 University of Waterloo and McMaster professors. "Your policy is an attack on science and the scientific process and should be changed by your leadership."
Some faculty are already considering leaving the province.
Story continues below advertisement
Dr. Robert E. O'Dell is chair of geography for the University of Regina and is considering leaving. "I'm pretty sure it's in the best interest to be the last person to retire in either of those two faculties. I'm not certain that either faculty are going to be able to do that. Either one is going to be much, much harder to replace. I think we need someone to step up and step in and fill the void," he said.
It is one of the demands of the group, in which only six professors and five students are involved.
The group hopes the government and Ontario will join the debate on scientific tenure and the tenure system.<|endoftext|>In the months since I wrote my first novel, the world of The Girl in the Red Hat had been shifting and shifting in my hands. For more than five years, I'd tried to keep it as consistent as possible. I had created a world where people who knew their work had been on screen for 15 years, never once felt like their identity as that work was questioned, only as we, onscreen, played the role of those that lived the reality of their work. And I had written that world. But in the midst of all the drama and drama, I didn't try to do as well as an artist on the small canvas I'd built. So, I went to the best writers I could find: the ones that were already working on big projects, or that I loved to read in the first place.
And for years, I tried to do the same.
I'm not alone.
One of the things I love about being a writer is that you can spend so much time on that page in your mind, in the first draft, or in the final edited word, that you'll never get to touch it. But it's really really important for you as a writer. Because as I was going to go to the writer's room, and my thoughts were going to drift from one paragraph to the next, and my thoughts would turn to the next writer, and my thoughts would turn to the next novel, and I'd get lost all the same. And I spent so much time thinking about those drafts. Some days, I thought for hours, some weeks. And all that time I got the best material. And that was all I got. But there are always other moments.
This is where I start thinking about the fact that there are other moments that are better. Some of them I never knew.
There are moments for me to get lost in.
There are minutes to watch the movie "The Godfather" and still not fully have what it takes to be the mobster we wanted to be the mafia we wanted to be. There are moments that are better to watch than those scenes where I just get lost in the world, and then have to wait until the next day or the next week or the next four days.
There are moments that I think, I will never achieve, because of those moments.
And I want to share some of those moments, because there are these moments, not every time, but there are times where I'm not sure if I'm going to be able to reach for them.
These moments, for me, are the moments when I know I will never be able to do what I want, because there isn't enough of this one thing that gives them meaning.
I don't have answers. What I have is this one thing, and I feel like I have no choice in the end.
One of the things I
Meer NLP for fun ! - 02 - Verder met 117M model met filmscripts
En nu een voorbeeld na 5000 epochs:
... afraid, it just so happens that Mr. Robinson has an autistic son. So Mr. Robinson is the only one left.
TOM
And he can't climb.
CATES
Is that so?
RACHEL
No it's not!!
(stares at photo)
The picture pops up on TOM's wall. He reads it, thinks about it, then takes a breath.
CATES
Hey boy, you can make outafoot street out of this
couple of street lights!!
A man in street clothes turns and sees the advertisement. He
swipes the man's gun from his belt. The advertisement ends withANGLE OF
TAMARA on the pavement.
CATES
Okay I understand. Now it's up to you
to balance the great American dream with
the risk that will be taken if you
play coy with the law or worse.
Cates smiles, laughs with the officer, gets out of the car.
TAMARA
Okay. So take the gun out of my
belt and head back.
PRETTY LIZ is waiting, hands the advertisement off to her truck.
LIZ
Oh no, I don't want one.
TOM
So how do you do, manage to balance that
American dream with the risk that
I may someday step on someone
myself and touch some people's lives.
Totally.
TOM
How is your day going?
64.
LIZ
Well folks, it'sagood day but I
wanna offer some great free stuff.
Cates snatches up the advertisement, lights the commercial.
TOM
I'm impressed by the way you have
jammedatag order.
LIZ
Oh great then get free beer at six so
you can turn into some jack-o-
bear.
TOM
You sure about that?
LIZ
Yeah I am sure!
TOM
Oh god no you don't!
LIZ
I don't believe it. I mean if
your beer got 60 people going then
you're doing it wrong.
TOM
And I say this because I think you do.
LIZ
I don't think we should give people
big government checks and bounds.
We should just let us make our own
and give you the people doing the
obstructing our will do so in a
responsibly responsible and peaceful way.
TOM
Great! That is justawild wrong
nitty gritty!
LIZ
Well I don't think we should give people
big government checks and bounds.
This is our chance to do just that.
TOM
Great!! Great!! Do you love your free will
so much, that you are willing to risk it
for the greater good, which you
believe in, and yet you remainafamily
monopoly warden who
spend every dollar he can?
64.
Cates looks at him.
Awesome!! Great! Let's do a
great thing, then let's give people some
little incentive to live an honest and
responsible life.
LIZ
Great idea, great idea. But I would
like to see government provide
accompany room, at least for now.
CATES
Do you want one? It would be nice if
somebody take your kids to private
school next year. I know an
Indian boarding school in upstate New
York. They haveaguy
private school business.
LIZ
What?
CATES
Well I do have two sons, Noah and
Jorge. They haveabetter but I
want them to have the same chance as
my boys. I want government things,
no more an all-powerful special interests
picking battles with the people they
believe in. Is it possible to
stop the tide of good change coming from
the corporate age of government
if we stop the tide of good from
the corporate age of government?
The guy in the cowboy hat nods. He takes the gun out
of her hand.
TOM
You're welcome.
LIZ
I still don't get your point. I
just don't like government.
This is ridiculous.
TOM
Ok, now try folding it up and shove it
in the tooth.
LIZ
I-I want you to sign so I can swallow
it all. How do you know if I'm gonna
slip my teeth and jump with my car?
TOM
It's the only way I know, the one you
just got.
LIZ
Don't tell me that!
TOM
Do you?!...Well, I knowahot little
woman about the government. You sure do want
to turn the ship around Jackson.
(CRACKS)
WAITER!
He
... afraid, it just so happens that Mr. Robinson has an autistic son. So Mr. Robinson is the only one left.
TOM
And he can't climb.
CATES
Is that so?
RACHEL
No it's not!!
(stares at photo)
The picture pops up on TOM's wall. He reads it, thinks about it, then takes a breath.
CATES
Hey boy, you can make outafoot street out of this
couple of street lights!!
A man in street clothes turns and sees the advertisement. He
swipes the man's gun from his belt. The advertisement ends withANGLE OF
TAMARA on the pavement.
CATES
Okay I understand. Now it's up to you
to balance the great American dream with
the risk that will be taken if you
play coy with the law or worse.
Cates smiles, laughs with the officer, gets out of the car.
TAMARA
Okay. So take the gun out of my
belt and head back.
PRETTY LIZ is waiting, hands the advertisement off to her truck.
LIZ
Oh no, I don't want one.
TOM
So how do you do, manage to balance that
American dream with the risk that
I may someday step on someone
myself and touch some people's lives.
Totally.
TOM
How is your day going?
64.
LIZ
Well folks, it'sagood day but I
wanna offer some great free stuff.
Cates snatches up the advertisement, lights the commercial.
TOM
I'm impressed by the way you have
jammedatag order.
LIZ
Oh great then get free beer at six so
you can turn into some jack-o-
bear.
TOM
You sure about that?
LIZ
Yeah I am sure!
TOM
Oh god no you don't!
LIZ
I don't believe it. I mean if
your beer got 60 people going then
you're doing it wrong.
TOM
And I say this because I think you do.
LIZ
I don't think we should give people
big government checks and bounds.
We should just let us make our own
and give you the people doing the
obstructing our will do so in a
responsibly responsible and peaceful way.
TOM
Great! That is justawild wrong
nitty gritty!
LIZ
Well I don't think we should give people
big government checks and bounds.
This is our chance to do just that.
TOM
Great!! Great!! Do you love your free will
so much, that you are willing to risk it
for the greater good, which you
believe in, and yet you remainafamily
monopoly warden who
spend every dollar he can?
64.
Cates looks at him.
Awesome!! Great! Let's do a
great thing, then let's give people some
little incentive to live an honest and
responsible life.
LIZ
Great idea, great idea. But I would
like to see government provide
accompany room, at least for now.
CATES
Do you want one? It would be nice if
somebody take your kids to private
school next year. I know an
Indian boarding school in upstate New
York. They haveaguy
private school business.
LIZ
What?
CATES
Well I do have two sons, Noah and
Jorge. They haveabetter but I
want them to have the same chance as
my boys. I want government things,
no more an all-powerful special interests
picking battles with the people they
believe in. Is it possible to
stop the tide of good change coming from
the corporate age of government
if we stop the tide of good from
the corporate age of government?
The guy in the cowboy hat nods. He takes the gun out
of her hand.
TOM
You're welcome.
LIZ
I still don't get your point. I
just don't like government.
This is ridiculous.
TOM
Ok, now try folding it up and shove it
in the tooth.
LIZ
I-I want you to sign so I can swallow
it all. How do you know if I'm gonna
slip my teeth and jump with my car?
TOM
It's the only way I know, the one you
just got.
LIZ
Don't tell me that!
TOM
Do you?!...Well, I knowahot little
woman about the government. You sure do want
to turn the ship around Jackson.
(CRACKS)
WAITER!
He
vrijdag 16 augustus 2019
Meer NLP for fun ! - 01 - Start met gpt-2 met filmscripts
Al een tijdje niet meer gepubliceerd maar nu wordt het toch weer even tijd om wat voortgang te melden. Ik heb weer een stukje "natural language processing" opgepakt. Ik hoop wat verder te kunnen testen met de snel groter en beter wordende modellen als Elmo / Bert en GPT(-2).
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
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
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 :-)
Abonneren op:
Posts (Atom)