Transform any text into a patent application

Figure 2 From Scheerbart's Perpetual Motion Machine

Figure 2 From Paul Scheerbart’s Perpetual Motion Machine

[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:

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:

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:

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:

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.

46 thoughts on “Transform any text into a patent application

  1. 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.

  2. Transform any text into a patent application – Sam Lavigne | Better Quest

  3. Transform any text into a Patent Application (or linguistics, programming, + Kafka = epic) | NYC Startup News

  4. RT @newsycombinator: Transform any text into a pat... - Thej Live

  5. 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.?

  6. 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.

  7. 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 !!!

  8. This program can turn any text into a patent application | VentureBeat | Business | by Michael Leibel

  9. This program can turn any text into a patent application

  10. 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

  11. Turn literary works into patent applications with patent-generator | Designolics

  12. The Communist Manifesto, as a Patent Application | SerendiWitty

  13. Transform any text into a patent application – Sam Lavigne | newspeak

  14. El Manifiesto del Partido comunista como patente - Andar y Ver

  15. This, oh this…! | Allan Haverholm

  16. Excellent | Black Sky Photo

  17. Create your own patently silly patent applications » Murray J. Brown

  18. Alice in Patentland | IP Wise

  19. Excellent work — I ran Piketty’s “Capital In the 21st Century” through it and I got:

    “A device and method for growing chinese ownership”

  20. A device and method for becoming a man | Irresistible (Dis)Grace

  21. Off topic: Follow the ants, patent-text generator, rethinking Monopoly, birthday words | SiliconBeat

  22. 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!!

  23. Schlussspurt: Die letzten Links des Tages | Seite360 - Blog für Kultur

  24. San Francisco Game Designer Creates Program That Converts Any Text Into A Patent Application | Technology

  25. A method and apparatus for observing the rhythmic cadence; or, an algorithmic alternative archaeology | Electric Archaeology

  26. 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/

  27. A method and apparatus for observing the rhythmic cadence; or, an algorithmic alternative archaeology | archaeoINaction

  28. A Web-based Method and Device for Haunting Europe | Black Sky Photo

  29. Fleximatcher, a library to help parse natural language | jacopofar

  30. THE HYPERTEXT

Leave a Reply

Your email address will not be published. Required fields are marked *