Every day, people come into contact with texts like terms and conditions, rental agreements, and hiring documents. Most often, these are full of legal jargon, complicated words, and restated terms that make them long and too complex for the average, hardworking person to take the time to read. We wanted to make legal documents accessible to everyone because everyone should know and understand exactly what they're agreeing to, and no one deserves to get manipulated by a corporation.
What it does
Our program takes a file input from the user and parses it for keywords, like 'agree', 'data', 'third', 'information', and more that would appear in a Terms and Conditions agreement. It also chunks and summarizes these long texts to condense any repeated information. It outputs a more readable text in bulleted points, highlighting the most important information, including the data the user agrees to share and what the company will have access to. It also measures the change in readability by giving a score to the original text, and then one to the final output after simplification.
How we built it
We used a basic HTML template to create the page where users paste their terms and conditions. For the backend, we relied on Python libraries such as Transformers and NLTK to build simplified summaries. Specifically, we used a language model from Transformers called BART, which was trained on CNN/DailyMail articles to understand and condense text. Because terms and conditions are usually very long, we created helper methods to split the text into smaller chunks before running them through the model. Finally, to make the summary more readable, we used NLTK’s tokenizer to recognize punctuation and break the summary into bullet points. To provide a metric, we used textstat to calculate the readability score of the text before and after and this is displayed underneath the bullet point list.
Challenges we ran into
The BART language model we used is extremely big and restarts everytime the program runs so when you enter all of the terms and conditions into the program it takes a little bit to provide you with the summary. Additionally, we didn't realize at first that the language model could crash if provided with too much text at once so once we recognized that we added helper methods to split the user's text up into smaller chunks.
Accomplishments that we're proud of
We both had little to no experience with HTML, so working on that part of the project was new and interesting. It was also our first time using trained language models like BART and tools like NLTK, so we had to learn how they worked and how to incorporate them into our program.
What we learned
We learned how efficient trained language models can be compared to manually searching for key phrases, and how much the efficiency of each model affects a program’s usability. For example, while using BART made our program much smarter at recognizing text patterns, it also made the program less efficient because of its size and runtime. This helped us realize the importance of carefully choosing the right type of language model.
What's next for Terms&Conditions Simplifier
Ideally, we could modify this program to accept all types of legal documents, not just Terms and Conditions. This would allow users to pull key points out of anything they're trying to read through, including court documents, policy memos, etc. We would have to allow the program to look for different important words/phrases depending on the document, and also be able to 'translate' common legal terms like Latin phrases. Furthermore, we would try to learn about more language models and incorporate one that stores memory instead of restarting with the program like BART does, this way the user's simplified text will be returned much faster.
Log in or sign up for Devpost to join the conversation.