Skip to content

A library and corpus for generating a fake End User License Agreement (EULA)

Notifications You must be signed in to change notification settings

aschn/eulagizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eulagizer

A library and corpus for generating fake End User License Agreements (EULAs).

Disclaimer: The EULAs generated by this code have absolutely no legal validity, and are approved for humorous use only.

A few choice quotes that have been generated:

Please do not agree to the rules of common decency.

Special Provisions Applicable to Advertisers: You will not Misuse a Forum. You further acknowledge and agree that we will do so.

you hereby acknowledge that you have been bought through our brand and asset usage guidelines

The one major rule is that you are allowed to put ads on them.

Happy EULAgizing!

Step 1: Clean up the corpus

Raw EULAs have been copied from the web into the corpus_raw directory. (Many came from https://tldrlegal.com; some came from other sources.) To clean them, run

./parse_corpus.sh

This runs parse_corpus_file.py on each file in corpus_raw, and writes the output to a new directory called corpus. The result is a collection of files that have been tokenized for better semantic processing. For instance, in the Chrome EULA, all occurrances of "Chrome" are replaced by "{{{PRODUCT}}}", "Google" by "{{{COMPANY}}}", newlines by "{{{NEWLINE}}}", etc.

Step 2: Generate an EULA

In python:

# import class
from eulagizer import Eulagizer

# create an instance and load contents of corpus directory
gizer = Eulagizer('corpus')

# optional: add an additional file to corpus
gizer.add_to_corpus('path/to/other.txt')

# generate EULA text string
# length is the minimum number of words, other parameters are self-explanatory
# feel free to run this repeatedly until you get one you like :)
eula_text = gizer.run(length=500, product='Eulagizer',
                      company='Central Headquarters', website='company.com')

# optional: write to file
with open('path/to/output.txt', 'w') as f:
	f.write(eula_text)

How it works

The data structures and algorithms are adapted from this post from Agiliq, see the post for a brief explanation.

A few changes were made to improve the semantics:

  • Multiple files can be loaded into the corpus.
  • The Markov chain is always seeded with the first two words of one of the corpus files (e.g., "Terms of", "{{{PRODUCT}}} End").
  • The Markov chain always ends at a newline (in particular, the first newline that's reached after the text has accumulated the specified number of words).
  • It's possible for the Markov chain to reach a place from which there is no valid next transition. This happens if the only occurrance of the current pair of words was at the end of a file, so no next words are available. If this happens, the code will raise a RuntimeError—simply catch this and retry.
  • After the Markov chain has run, the resulting text is detokenized (e.g., "{{{PRODUCT}}}" is replaced with "Eulagizer" or whatever you want).

License

This software is covered by the MIT License: http://aschn.mit-license.org/

Copyright © 2015 Anna Schneider

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A library and corpus for generating a fake End User License Agreement (EULA)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published