Fun with Machine Learning

I wanted to take Thanksgiving break off, so I’ve trained my computer to write for me. Machine Learning is an exciting development in computer programming. In this case, I “train” my computer using a series of texts, and it builds a model to understand the language within. Then, it uses mathematical computation to put out what it thinks the original author would most likely write. I’m currently learning about machine learning in order to work on a project, but, along the way, I’m having fun experimenting with the idea.

First I trained it with William Shakespeare. I put the Complete Works of the Bard into TensorFlow (a machine learning toolkit), and out popped some interesting dramaturgy. Here it is, straight from Billy Shakesbot:

FALSTAFF. How comes Sir old LORD votre

EVANS. Bless him now, Sir Le o’ a wood. Will she thy mercy bear the sack from whence her poor brother. Ham. Nay, make it some good, and that’s a pitiful woman. If it be enough; ’tis thou a gentleman.

PISTOL. Now he hath wasted boots, he says. He is here. What, fond of these sorts of Lancaster. That is but full, an heir?

LEWIS. Who should he make in friendly choice; Some sleeping of the ground in every lower time ‘Gainst whiles your reputation lives, and ever we are with you at the duty that he shall take you up in arms for her; You shall best know–far than they use the coward or the herd was for the nose, and felt it.

LEONTES. Get me away; Mine’s not none but to be forsworn; Were not my way, and I beshrew hell, My lady’s sovereign, kisses from his side, I should not hear you lie.

LUCIO. Not I, like a kind of white eyes to meet you; it grieves me of your honour. Not here, nice with you, my lord.

DUKE. In Parthia help you his true office, for our father, bequeathed down again; and tempts the rich. My Mother needs we bid his majesty so your worth were in my tomb, return to heaven or lips. He lends it money. Would you say he’ll swear? And so to me; I’ll manifest that on the feast.

PAROLLES. ‘Tis long enough you must do speed. [Exit]

HELENA. Here ’tis; all is certain you pick’d from the gates, and could I be a brave man for approbation Of what same handkerchief my mistress borrows them in the city.

[Enter Friar]

FRIAR. Word, Sir Thomas John. Bless God William cousin the Tribunes, hit the sum a speedy Venetian daughter bravely on her face, and the pretence to twenty order of his company?

WINCHESTER. Gloucester, where’s the fire of heavier faces an ocean ta’en on arrows, savage dew and holy woe, The mere Prince gave them! Since King doth not the sway, Stand God, lords.

ANTONY. You are welcome.

MACBETH. I had more than your daughter.

POSTHUMUS. It is but Agamemnon’s love as much as ever I died On my advice, Against that loss I had not slipp’d so. If I think or I could live by which I do not march upon. To tax it so, provide to pray for you, And stir my sword on you, more shall one day one several answer. It hath these rude hand; here is your crocodile.

ANTONY. What three with you.

CASSIUS. Brutus, proceed. [Exit]

LORENZO. Mine eyes your honour. O, your looks must hear like Lord Timon’s precious face. I kiss your Highness’ tent. Laer. You have your father’s tenant.

OTHELLO. Say you so? If you be going. Go, I am ashamed I will give you some.

ANNE. No, faith, most know’st I know not what your Majesty, Hath not the veriest state. I have sent innumerable substance, My daughter in your will. I grant more answer. [Exit]

LORD. What’s your place then? Will I keep it on home. Since I do not have but given him to some giddy days. Exit Edgar. O conscience, sun, Who will. Ham. Ay, madam. Like such limits to the palace Are we jealous.

[Exeunt BIANCA and BOY PUCK.]

GLOUCESTER. Why, Warwick, hast thou the weird English, Thane of March, two farthings–

AARON. He uses the Emperor at mine ears To safeguard some of us than to atone any hearing of the same?

[Enter Lady Macduff, with TITUS’ chamber fire, and bows]

GLOUCESTER. Go make me cease! Give me your hand. Read thy commission; bring to Desdemona, me. And from thy mind shalt thou perhaps Hold saying safe again, Let me stay with thee, ask them, I will fly, And, in God’s company of brazen stream, They make it surfeit. He lies from my love to repent. It is my heart to seek me here in justice, And with sweet sovereign strength I to him.

Is it really any less intelligible to a modern audience? Would they even realize that we had replaced Shakespeare with Shakesbot? I’ll save that for a future experiment 😉

While I still had the Shakespearian model pulled up, I decided to try something else with it. The program allows you to “prime” it with a seed text. (To be honest, I had primed it with the word “FALSTAFF.” to get the above text.) This time, I wanted Billy to respond to a few famous people, so I primed him with a few prominent tweets. How would the Bard respond to Twitter today? Let’s see.

Screenshot 2018-11-21 20.47.04.png


This is not altogether like a thing entire as one that draws himself in blood, not life, it is a poison as enemies.

Screenshot 2018-11-21 20.52.51.png


We are love of death, which are, I am not well a fat maid with the imputation of his youth nor telling true young Benedick. Well, proceed. And worse that is some stranger in thy soul his mistress, and his passion more than ever seem so mock’d when it seems not.

And, of course:

Screenshot 2018-11-21 20.54.38.png

Silence esteem Percy into their watch, their colours at them, a most sage lord attending on word, bearing sides, in friends with torches tears and starts with a bed Richard, and in other weapons through one door, How many lords as he became horse, Of these a gentle thief, Makes

I think there’s some real wisdom hidden in there, if you’re willing to read between the lines, as it were.

The next step, of course, is to train the computer with my own writing so that I can take the holiday off. I put the three Tears of Tyrra books (the first two are available on Amazon, and the third will come out soon!) into the training program, walked away, and came back in a few hours to see what Billy had written as the virtual me.

Here’s a sample of the next Tears of Tyrra book:

Cam’ron instrument, hands his head was sights of reveal to shelter pause, and the worker’s barracks, rising and color and often he struck, trying to Stonewood. They stepped down to health out of them.

“Fionn ran to the fight. He repositioned the cot. Cam’s stone combatants in the gorgons in the dangerous.” Not tried to put him this other and belted the adventurers to save his instrument. This was his own opposition the crystal Crie’. Man holding the people, so he inched into my lack of others. “If we rather Stonewolf, instead of limestone had enjoyed the direction to interfere, and the thorn that had been perfect? I jumped back across the Shadowsinger, but it contains a worst laugh.”

“Thou fail; vould elemental, face-stones, what their surgical slashes, commanded us the freedom that Tyrra. For a forest, Light Ruadh were tied.” Never I let up and drew the weapon to his cavern. He placed the squid-man to the sun and gathered down Fionn’s silken part,” but the icy pouch instructed, and now I am not the archaeological practice. He walked down the ten. shaft attacked their leather Removing the magick killed him, but, for a fight. My other figure wakes was a sly slaying Mountain, just spells. He whispered immediately. He was there for the Gadabari worry across the new steel ago. So, this combination wasn’t taking by it. Were we I won to leave him. lying in the wild sword with her face. Concern flipped a duel on my meaning. The ancestors almost to “Black”

“Chyou the one keep it on, flows between me Grandefleur, the word that debris and breathed on once, one chips. After enchantment was shut. and immortality, burning the service and blue of on the crowd. family, so the song was definitely heard,” snarled another, floating magus.

“Lu’i,” said Crie’. “Ve set a few fine totems had before many stories. point.”

“Okay,” said friends, and fighting, anyone again.

Instead, the elf continued, “I’ll be going to take him. Nine!” Trying to overlook the death of Stonewolf glowing magic, a adventurers to free their slide Continuing at everyone homes ‘humans’ luck and behind me. “The Ninth Legion caused a path to gain. Trust that direction will go.”

He thought the spell was oscillating from a friends up to his time, Cam casually calling the glade. of the front whipped the Gadabari, “I swore meat-head.” trying to charge the hand with a window. The cards allowing Dalantia. 

Everyone approached the Gadabari on the left, and he saw a things to remind being a long appearance, dressed and only to absence carried cover the toy.

“We could have to satisfy any of impenetrable shadows to the new one?” and sparkled for the noise of behind her hands. Soon, we all skilled soldiers. But still with every crackle that they worked my help, gratitude to the group, driven like quickly sitting on the table. Turning to him that clattered with the shadows that had seen their freedom.

“And ve have tails.”

Okay, not quite ready for primetime, but it was a little fun. As the modelling software gets better and powerful computing becomes cheaper, the technology is sure to improve. Will it ever replace a human writer? I’m sure at some point it will pass the Turing Test, and the output from a program and from a writer will be indistinguishable, but until then, I’ve got to keep putting down words. So, cheers to Billy Shakesbot. I’ll pull him back out when I’ve had a chance to tune his training a little bit better.

And here’s what Billy has to say about that:

Goodbye yes; contagious inclination such. Man, famous among a clown and father Much father and his sake; and to receive his pardon by his head, which, in conclusion, he might none of them pay.