[Hello everyone! Thanks for taking a look at my blog! If you want updates on this project or other things I’m working on, just follow me on twitter]
I wrote a program that transforms literary and philosophical texts into patent applications. In short, it reframes texts as inventions or machines. You can view the code on github.
I was partially inspired by Paul Scheerbart’s Perpetual Motion Machine, a sort of technical/literary diary in which Scheerbart documents and reflects on various failed attempts to create a perpetual motion machine. Scheerbart frequently refers to his machines as “stories” – I wanted to reverse the concept and transform stories into machines.
In this post I’ll provide some details about how I wrote the program, and describe some of the tools that I used.
First, here’s some sample output, listed by invention title and source text:
- “A method and device for comprehending theoretically the historical movement” (The Communist Manifesto)
- “An apparatus and device for staring into vacancy” (The Hunger Artist by Kafka)
- “A device and system for belonging to bringing-forth” (The Question Concerning Technology by Heidegger)
The program operates in four parts. First it generates a title for the invention, then an abstract, then a list of illustrations, and finally a more detailed description of the “embodiments” of the invention.
In general, my methodology is to find common grammatical structures in patent applications, and then extract sentences containing similar grammatical structures from my input texts. To do this, I make heavy use of the Pattern library, which, among many other wonderful features, allows you to perform regular-expression-like searches using parts of speech. For example, here’s how you can use pattern to to search through a text for all instances of an adjective followed by a plural noun:
1 2 3 4 5 |
from pattern.search import search from pattern.en import parsetree t = parsetree('A lot of things are ruining a lot of other things') print search('JJ NNS', t) |
Title Generation
There are a number of grammatical patterns that I noticed in patent application titles – one that stuck out to me is “[NOUN] (and [NOUN]) for [GERUND] [NOUN PHRASE]”. For example:
- Method for concealing partial baldness
- Method and apparatus for finding love
- Web-based system and method for preventing unauthorized access to copyrighted academic texts
To create my invention titles, I simply search through the source text for “VBG * JJ? NP”, which translates to “a gerund, followed by anything, followed by an optional adjective, followed by a noun phrase.” The program selects an arbitrary title from all the options it finds, and then prefixes the title with a random combination of “system”, “method”, “apparatus”, and “device”. Occasionally it’ll add “web-based” into the mix as well. Here are a few of the many possible titles generated from the Communist Manifesto:
- a web-based method and device for haunting Europe
- an apparatus and device for rounding of the Cape
- an apparatus and system for surpassing Egyptian pyramids
- a web-based method and device for revolutionising the instruments
- a system and device for clearing of whole continents
- a web-based apparatus and method for paving the way
- a system and apparatus for diminishing the means
- an apparatus and system for fighting the bourgeoisie
- a method and device for depicting the most general phases
- a method and device for begetting a new supply
- a method and apparatus for appropriating material products
- a device and system for appropriating intellectual products
- a system and device for springing from your present mode
- a method and apparatus for having the wives
- a web-based apparatus and method for desiring to abolish countries and nationality
- a system and method for fluctuating between proletariat and bourgeoisie
- a system and method for redressing social grievances
Generating an “Abstract”
Typically a patent application will have an abstract that describes in brief what the invention is comprised of. To generate my abstracts, I follow a similar method to the title generation, searching through my source text for instances of adjectives followed by singular or plural nouns. However, in this case I make a small but significant change. I restrict the possible nouns to those that fit into the category of “artifacts”. For example, here’s the abstract that gets generated from Heidegger’s essay on technology:
The devices comprises a wooden bridge, a technical apparatus, a high-frequency apparatus, a whole structure, a human handiwork, a mere handiwork, an autonomous tool, a hydroelectric plant, an actual chalice, an old windmill, a sacrificial chalice.
In order to do this, I wrote a function that searches first for grammatical patterns, and then filters that output based on hypernyms. A hypernym is a word that fits into a level of categorical abstraction up from another given word. So, a hypernym for “car” is “machine”, a hypernym for “pigeon” is “bird”. We can consider words sharing hypernyms as belonging to the same abstract category. This in itself is a fun tool to play with. For example, I can enter the following into my my program:
1 |
python search.py < kafka.txt 'organism' 'JJ NN' |
And I get a list of all the adjectives followed by nouns that fit into the “organism” category in Kafka’s The Metamorphosis:
- old man
- own mother
- timorous visitor
- observant sister
- tired man
- junior salesman
- expressive violinist
- middle gentleman
- good man
- unfortunate son
- old maid
- elderly widow
- horrible vermin
- elderly mother
- chief clerk
- wild man
- fall victim
- sensible person
- lazy son
- much mother
- commercial traveller
- young lady
Fun!
Illustrations
The next part of the program generates a list of “illustrations”. This time I search for phrases that fit into a grammatical structure that looks like “DT JJ NP IN * NN”, or, “determiner followed by adjective followed by noun phrase followed by a conjunction followed by anything, followed by a singular noun“. I attach these phrases to other randomly selected phrases commonly found in descriptions of patent illustrations. These “illustrations” come from Gargantua and Pantagruel by Rabelais:
- Figure N illustrates the great puffguts of the counsellor.
- Figure N is a schematic drawing of the first book of this translation.
- Figure N is a perspective view of the old women in rut and heat.
- Figure N is an isometric view of the middle finger of his right hand.
- Figure N schematically illustrates a little peach-coloured bonnet with a great capon.
- Figure N is a block diagram of the inundation of the urinal deluge.
- Figure N is a cross section of the perfect image of my body.
I debated attaching actual illustrations to these descriptions, and even wrote a script to scrape Bing images for various patent illustrations, but in the end I decided the texts alone were better. I might explore the idea of programmatically creating illustrations in the future.
Detailed Description
The last part of my program creates a more detailed description of the invention. It does this by searching for “VB|VBD|VBZ|VBG * NN IN * NN”, or “any verb, followed by anything, followed by a noun, followed by a conjunction, followed by anything, followed by a noun.” I attach these, as in the illustrations section, to commonly found phrases in patent descriptions like “the present invention”, and “according to preferred embodiment”. Here are some excerpted results, from the Communist Manifesto:
The present invention is itself the product of a long course. The present invention finds its fitting complement in the most slothful indolence. The present invention creates a world after its own image. The present invention endangers the existence of bourgeois property. The present invention becomes an appendage of the machine.
According to another embodiment, the device layers the foundation for the sway. The device abolishes the right of personally acquired property. The device is the groundwork of all personal freedom.
According to another embodiment, the device is the miserable character of this appropriation. The device is the non-existence of any property. According to a preferred embodiment, the device deprives no man of power.
In accordance with an alternative specific embodiment, the present invention finds its complement in practical absence. The invention alters the character of intervention.
According to another embodiment, the device keeps even pace with dissolution. The invention is the most radical rupture with traditional property. The present invention is the condition for free development. The present invention comprehends the march of modern history.
According to another embodiment, the device is the necessary offspring of its own form. The present invention conceals the reactionary character of criticism. The present invention is the expression of the struggle.
According to a preferred embodiment, the invention expresses the struggle of one class. The invention presupposed the existence of modern bourgeois society. The invention improves the condition of every member.
Closing Thoughts
Soon I’ll create a little web service that runs the script on any user input. For the moment though you can download the code on github. The code base includes a number of (possibly) useful tools:
- “machine.py” generates patents
- “search.py” searches texts for parts of speech and hypernym combinations (among other things)
- “get_illustrations.py” scrapes Bing for patent illustrations
- “scraper.py” downloads the full text of patent applications based on keywords
BY THE WAY, if you ever want to kill a few hours, just search google patents for the dirtiest words you can come up with. You will not be disappointed.
I don’t know how you did it, but you managed to combine the exact three things that I love most in this world: linguistics, programming, and Kafka. Do you have any background in computational linguistics? My python is a bit rusty – hoping you could explain how you came up the hypernym filtering function. Hats off to you, this is the coolest thing I have seen in a long time.
Transform any text into a patent application – Sam Lavigne | Better Quest
Transform any text into a Patent Application (or linguistics, programming, + Kafka = epic) | NYC Startup News
RT @newsycombinator: Transform any text into a pat... - Thej Live
Hi,
Could you make a code that checks patent specifications for formality matters, e.g. consequent use of reference numbers, features in claims mentioned in the detailed description, correct references in claims, using standard subtitles, e.t.c.?
This already exists!, is very expensive, and likely has been patented.
This is awesome, and shows the potential of automated text analysis and document generation for the patent field.
Not only is this a great little toy, I think you have predicted how patents will be drafted in 5 or 10 years time.
This is a super cool application :) I have actually penned down a few patent specs and passed over my “raw” work to patent attorney who then in turn produce a formal patent disclosure very similar to what your application does. Hats off !!!
Came by to let you know #bitcoin-assets loves you now.
This program can turn any text into a patent application | VentureBeat | Business | by Michael Leibel
This program can turn any text into a patent application
One day we’ll be able to pull out our phones, tell Siri our ideas, and quickly have patents created.
…quickly have your ideas stolen by Apple.
This program can turn any text into a patent application | Web Tech News | Free technology news with the latest investments, gear, industry and copyright news
Please let me know if and when anyone sets this up as a browser-accessible web service.
Awesome!
Turn literary works into patent applications with patent-generator | Designolics
The Communist Manifesto, as a Patent Application | SerendiWitty
Transform any text into a patent application – Sam Lavigne | newspeak
El Manifiesto del Partido comunista como patente - Andar y Ver
Soon I will replace my own brain with a cloned copy of your brain Sam because even your cloned brain is a genius.
I’m going to use your software to transform the text on your website into a patent application.
Mu-WHAHAHAHAhahahahah!!!
Will you patent an evil petting zoo?
This, oh this…! | Allan Haverholm
Excellent | Black Sky Photo
How is the program supposed to be run:
python machine.py
and
python machine.py foo
just hang….
try this
python machine.py < foo.txt
Ok; I will try that. Maybe you could add support for the the conventional
python myprogram,py –help
to show what the command line parameters are?
Help anyone with error that says “The system cannot find the file specified”
Try
python machine.py < yourtext.txt
Found my error. So much fun! Thanks for this!
Create your own patently silly patent applications » Murray J. Brown
Alice in Patentland | IP Wise
Excellent work — I ran Piketty’s “Capital In the 21st Century” through it and I got:
“A device and method for growing chinese ownership”
A device and method for becoming a man | Irresistible (Dis)Grace
Off topic: Follow the ants, patent-text generator, rethinking Monopoly, birthday words | SiliconBeat
You should file a patent app on this!!! BTW, have you seen the “Godly Powers” patent app. If you haven’t, check it out. Hilarious!!
You cannot patent software or computer code. These things are abstract.
Thank you very, very much. I see a happy beery evening ahead.
Schlussspurt: Die letzten Links des Tages | Seite360 - Blog für Kultur
San Francisco Game Designer Creates Program That Converts Any Text Into A Patent Application | Technology
A method and apparatus for observing the rhythmic cadence; or, an algorithmic alternative archaeology | Electric Archaeology
This is a brilliant toy. My background is in archaeology. I’ve been running some classic archaeological works through it…
Here’s Casear Patents the Gallic War https://docs.google.com/document/d/1gmE8ukf27BqKHafXEsSOSW_zQo1d3BB_q-gyO_KzNl0/edit?usp=sharing
And here’s Heinrech Schleimann on patenting Troy – http://electricarchaeology.ca/2014/06/20/a-method-and-apparatus-for-observing-the-rhythmic-cadence-or-an-algorithmic-alternative-archaeology/
A method and apparatus for observing the rhythmic cadence; or, an algorithmic alternative archaeology | archaeoINaction
A Web-based Method and Device for Haunting Europe | Black Sky Photo
Fleximatcher, a library to help parse natural language | jacopofar
THE HYPERTEXT