-
selecting the clauses
-
setting calander deadline
-
uploading pdf
-
portfolio summary
-
summary of doc
-
clauses check
-
checking and double checking the confidence level of clauses
-
evidence of checking the AI clauses with python based on the raw doc
-
clauses flagged by AI as important
-
any question you can ask regarding the portfolio
-
any due dates in the next 40 days
-
flags out conflicts between contracts
-
each contract output is downloadable as word doc for word doc and highlighted terms for evidence and ease of sharing
-
highlights parts of the word doc for flagging market standards
Inspiration When was the last time you read the terms and conditions of an online service fully? For some of us, maybe not at all. Many of us fall victims to this trap, where we simply assume that there are no hidden clauses. This isn’t just limited to individuals, companies face this exact problem everyday, where it seems like too much of a hassle to go through every term of a contract, and it’s so much easier to just skim through it. The problem presented to us was something that was a huge issue many people face nowadays — contracts.
Our solution The user simply has to upload a contract in the form of PDFs, Word docs, even a scanned copy someone photographed on their phone. They also need to input the date of the upload itself. Firstly, the AI flags the clauses chosen by the user found in the contract. This can be who's involved, how long it runs, how it renews, how you get out of it, what you owe, liability caps, exclusivity, etc. This includes the exact citations of the clauses and where it is found, be it the page or paragraph number. This is checked once again by the code, which ensures that there is no hallucination. Secondly, it considers the risk management of the flagged clauses. Any contradictions in the contract as well as risky clauses will be highlighted. This risk threshold is determined by market standards, where it considers the average time-period or liability percentages based on the specific industry. Lastly, the AI pulls out any dates mentioned. This can include payment dates, performance dates, etc. Using these dates, it builds a 90-day calendar of what's due. This is all put into a downloadable document consisting of all the above.
How we built it We used Streamlit, Python, pdfplumber for reading PDFs, with OCR for scanned pages. We first started with Gemini but the server was constantly overloaded and we weren't able to run our code. After that we tried Groq, which was fast but had a tiny free-tier token limit that we kept exceeding past when our prompts got more detailed. We ended up using OpenRouter running DeepSeek, using the hackathon's own provided credits, which finally let everything run fully.
Challenges we ran into The biggest challenge we faced was ensuring the accuracy of our model. Specifically, the conflict checker. When we created 2 contracts with conflicting exclusivity rights, our model had missed it at first, because it only compared each contract's "exclusivity" field, and the second contract never used that word at all. To fix this, we implemented the independent verification system, which checks the AI against the source document. Afterwards, we have 4 stages for the confidence level of the AI, in terms of how well it understood the clause, be it implied or expressly stated. Additionally, we hard coded in 5 Singapore Acts that all contracts have to abide by to ensure an external source. Our model will not give legal opinions and inaccurate answers not based on data given. Another challenge that we faced was how long it took for the model to finish analyzing a contract. The first few times took about 9 mins per contract, which was too long. At first it was due to a pause in between each contract due to grok which had streak red limits. Afterwards, when we moved to the open router, this problem was solved. We used parallel processing with ThreadPoolExecutor, allowing for multiple contracts to be processed simultaneously. We also raised the timeout from 25s to 120s.
Accomplishments that we're proud of We’re proud to present a model that chooses accuracy over efficiency. Our model can and will admit if there’s not enough data to support a claim. This is especially prominent in our risk assessment sector, where if there's not enough data for a clear risk assessment, the model will simply state as such. This sets us apart from the usual AI model, where there isn't any 2FA to ensure accuracy. Considering the scope of the legal industry, it is one that treasures accuracy above all else.
What we learned We learnt the importance of accuracy, and how to make it happen. It wasn’t anything new about the legal industry requiring 100% accuracy, but the issue was how to implement it. AI often hallucinates, which can affect our accuracy in terms of output. What we did was to simply implement the 2FA system, and integrate the prioritisation of accuracy over efficiency.
What's next for team 11, L'Estrange We want to make the model more customisationable across different industries. Every industry has its own standard practices and hence clauses. Our model is merely trained to the average contract and not in a highly detailed and specific manner. What we would need would be actual data of contracts from different fields to help train our model further
Currently, it is only using the provided datasets under CUAD, so it has wide but not deep understanding. So, our next step would be to secure the datasets to train the model further.