Lessons Learned from the Hemingway Editor

As an exercise, I tried rewriting an essay I wrote for this blog, Ergot on Rye, in the Hemingway editor. I learned that my writing in too academic. It is too hard to read. Expressions need to be simpler. I need to use fewer qualifiers.

The Hemingway editor helps me break down some of those learned habits. It also has direct to WordPress publishing capability. But, it’s only available for Windows and MacOS. writegood-mode in Emacs might be an alternative on Linux.

Below are quotes from the first few paragraphs, followed by their rewritten counterparts. The difference is quality is obvious.

Original:

“tl;dr: Ergot is a forgotten plague that teaches a lesson about the cost of ignorance, and perhaps, offers another one on the price of sanity and the value of a little madness. (1,620 words)”

Rewritten with the Hemingway Editor: “tl;dr: Ergot is a forgotten plague that teaches a lesson about the cost of ignorance, and perhaps, offers another one on the price of sanity and the value of a little madness. (1,620 words)”

“This is a cautionary tale about ergot. Ergot is a fungi of the genus Claviceps that is a parasite of grains — primarily rye, but also triticale, wheat, barley, sorghum, pearl millet and rarely, oats. It has two major effects: (1) hallucinations, often with convulsions or epileptic symptoms, and (2) constriction of the blood vessels in the extremities that lead to gangrene and/or death. Generally, it is one or the other, which predominates likely depends on ergot genetics and the alkalinity of soil in which it grows. Other symptoms include strong uterine contractions (making it an effective abortifacient), nausea, seizures, high fever, vomiting, loss of muscle strength and unconsciousness. Its active ingredient is lysergic acid, a precursor to lysergic acid diethylamide or LSD. Historically, tens of thousands of people have died, been disfigured, or gone mad from ergot poisoning. Today, it is controlled and very rarely effects anyone.”

Rewritten with the Hemingway Editor: “This is a cautionary tale about ergot. Ergot is a fungus. It is a parasite of rye. But, it also grows on triticale, wheat, barley, sorghum, pearl millet and rarely, oats. It has two major effects. One, it causes hallucinations, convulsions and seizures. Two, it constricts the blood vessels in the extremities causing gangrene and/or death. Which effect happens depends on ergot genetics and the alkalinity of soil in which it grows.

Ergot also causes abortions, seizures, fever, vomiting, loss of muscle strength and unconsciousness. Its active ingredient is lysergic acid. Lysergic acid is a precursor to lysergic acid diethylamide or LSD. Ergot poisoning has mutilated, driven mad or killed tens of thousands of people. Today, it very rarely effects anyone.”

“Historians have speculated that lysergic acid in ergot may have been converted into ergine by boiling ergot-infected rye for an extended period of time. This process matches historical recipes for kykeon, which was the drink culminating a religious fast in the Eleusinian Mystery cults and perhaps used in other mystery cults as well. While there is some archeological evidence for the existence of rye after the Bronze Age, it did not become a widespread food staple until the Middle Ages.”

Rewritten with the Hemingway Editor: “Boiling ergot-infected rye for an extended period of time converts it to ergine. This matches historical recipes for kykeon. Kykeon was drunk at the culmination of religious fasts. Eleusinian Mystery cults used kykeon in their rituals. People ate rye after the Bronze age. But, it did not become a widespread food staple until the Middle Ages.”

“Rye is a grain that grows on marginal lands. During the High Middle Ages (1000-1250 C.E.), there was a population boom and expansion that put pressure on the food supply, and as a result, rye was seeded in the winter to provide a bonus and/or nurse crop for more extensive agriculture. With the increased eating of rye by the population, the effects of ergot became more widespread and notable. For example, possibly the first example of a dancing plague in the historical record is a 1021 C.E. incident in the German town of Kölbigk:”

Rewritten with the Hemingway Editor: “Rye is a grain that grows on marginal lands. During the High Middle Ages (1000-1250 C.E.), there was a population boom. The expansion put pressure on the food supply. As a result, planting rye in the winter provided a bonus and/or nurse crop for more extensive agriculture. With more people eating rye, ergot poisoning became more widespread and notable. For example, the first example of a dancing plague is in a 1021 C.E.. It happened in the German town of Kölbigk:”

“Except for the apocryphal year punishment, these outbreaks of dancing mania closely match the descriptions of the Eleusinian Mystery rites after consumption of kykeon, which suggests a reaction to a hallucinogenic variety or ergot. Perhaps, the psychological effects lasted for a year because that’s how long it took the population to eat through their store of rye grain for that year? Whether this story is an accurate depiction of events or has apocryphal elements, it is clear that a widespread mania is preferable to gangrenous ergotism. The first major documented case of gangrenous ergotism happened in the Rhine Valley, in 857 A.D., but it recieved it’s common name of “St. Anthony’s Fire” during the 1039 C.E. outbreak in Dauphiné, France. The cause of ergotism, at that time, was unknown. It’s not hard to imagine that those inflected with madness from ergot would be seen as being possessed by the Devil and the gangrenous form as punishment for sin. To speculate, perhaps ergot had a role to play in religious purity movements such as the strict vegetarian Carthars and the subsequent Catholic crusades and inquisitions that were in response to it.”

Rewritten with the Hemingway Editor: “Dancing mania matches of what happens after consumption of kykeon. This may be a reaction to a hallucinogenic variety or ergot. It lasted for a year because that’s how long it took the population to eat through their store of rye grain. This story is may be apocryphal elements. But, it is clear that a widespread mania is preferable to gangrenous ergotism.

The first major documented case of gangrenous ergotism happened in in 857 A.D in the Rhine Valley. It received it’s common name of “St. Anthony’s Fire” during the 1039 C.E. outbreak in Dauphiné, France. The cause of ergotism, at that time, was unknown. People blamed the madness from ergot as possession by the Devil. The gangrenous form of ergot poisoning was punishment for sin. Ergot played a role in religious purity movements. The strict vegetarian diets of Carthars may have been in response to ergot poisoning. As the Catholic crusades and inquisitions may have been a response to were in response to it.”

Robin Sloan & Writing With The Machine

I am just so compelled by the notion of a text editor that possesses a deep, nuanced model of… what? Everything ever written by you? By your favorite authors? Your nemesis? All staff writers at the New Yorker, present and past? Everyone on the internet? It’s provocative any way you slice it.

I should say clearly: I am absolutely 100% not talking about an editor that ‘writes for you,’ whatever that means. The world doesn’t need any more dead-eyed robo-text.

The animating ideas here are augmentation; partnership; call and response.

The goal is not to make writing “easier”; it’s to make it harder.

The goal is not to make the resulting text “better”; it’s to make it different — weirder, with effects maybe not available by other means.”

Robin Sloan, “Writing With The Machine.” robinsloan.com. May 2016.

Robin Sloan hacked together some software to use a neural network trained against some corpus of text, e.g., Shakespeare, that then makes suggestions on how to complete sentences you write. He’s right that it doesn’t make writing easier. It makes it harder because it is essentially implanting non sequiturs into your writing that then have to be thoughtfully incorporated or erased. But, it does make your mind go off in different directions that would not occur if you were merely composing something on your own.

In order to try it, you have to install torch, torch-rnn, torch-rnn-server, the Atom text editor, and rnn-writer. It’s probably easiest to get it going on Linux or MacOS. The instructions are not entirely clear, and I failed to get it working the first time I tried. I made a second attempt yesterday, and I got it to work. The main thing is to go through all the instructions. Look for flags or how it can be done manually if it fails. I also didn’t realize that the torch-rnn-server requires git cloning and moving to the relevant directory in order to get the server to run.

Also, you should use the pre-trained model to make sure everything works first. Get the server running, connect it to your Atom editor and get a feel for the possibilities. However, you’ll probably find that the pre-trained model leaves quite a bit to be desired.

But, training up the model on a preferred text can take quite awhile if you are doing it on a consumer grade computer. I picked the King James Version of the Bible as my reference text, and I’m doing the training on an old laptop. By my calculations, it will take around 70 hours to train the model. It’s not a trivial exercise.

After trying the pre-trained model, it probably makes the most sense to try training the tiny-shakespeare.txt file included with torch-rnn-server, as a first walk-through of training up your own neural network from a specific text. This way you aren’t spending several days training up something you aren’t sure is going to work.

After that, take a look at Project Gutenberg. I can imagine using a neural network trained on years of our emails, Montaigne, old slang dictionaries, or Grimm’s Fairy Tales to different affect on our writing. There seems like a world of possibility with this approach.

Good luck!

How the Godfather of Cyberpunk Would Write Software

“[Cyberpunk science fiction writer William Gibson] begins each day by reading the whole manuscript again…

…What if we began each day by re-reading all the code [reviewing all the numbers, editing the work, revisiting our assumptions, etc.] we’d written for the story/feature/bug we were working on?

…Skimming is a kind of reading, but it’s often fooled me into believing I know more than I do.”

—Marcus Blankenship. “How the Godfather of Cyberpunk Would Write Software.” Hackernoon.com. November 4, 2017.

Thought the need for immersing ourselves in our material, revisiting, editing and evolving before we move into expanding and creating something new was an interesting idea, one that runs counter to the tendencies of our time. Might also explain why his books tend to be short.