top of page

Use AI for 
automatically searching through legal documentation

In the past few years, the demand for solutions to quickly search legal documents has increased rapidly, due to the large amount of legal documents available electronically. Text search is one area where AI has achieved great success. This article provides insight into the application of AI-driven search methods for finding relevant information in legal documents.

The Challenge

Our legal system depends on accurate information gathering, and in some jurisdictions lawyers are even ethically required to be adequately informed about relevant legal documents. However, information retrieval in legal documents is complicated and standard methods are often not applicable because law rarely has an inherent taxonomy. On the other hand, it would be extremely time consuming if lawyers had to search the documents themselves. This underscores the need to use NLP techniques and Deep Learning for automatic search in legal documents.

The opportunity for deep learning

Using modern NLP techniques, people can learn to understand the meaning of a text rather than just looking at the words in it. There are many areas where these techniques are valuable, and they can be used very well to find relevant information in legal documents. In this use case, the technique we want to apply is called text similarity and can be used to automatically search selected legal documents and find the sentences with the most similar meaning, even if the sentences do not share a common word. Therefore, similarity search can be used as an engine for searching legal documents.

Platform model to use

Preferably, this use case can be solved by text similarity using the Universal Sentence Encoder from

How does the model work?

In a nutshell, a text similarity search for this use case works by comparing a search term to all the sentences in your legal documents, with the goal of returning the sentences that are most similar to your search term. Because the model is trained to understand the meaning of the text, it is also able to generate numerical representations of the text. With similar text, the numerical representations are close to each other due to the numerical distance. Thus, if you create numerical representations for each sentence in your legal documents, you can match the numerical representation of a search term to all other sentences and return the sentences that are closest to the search term, i.e., the most similar sentences.

Data requirements

In order to setup this solution, you need legal documents that you want to search and the amount depends on how much data you want to search.

Modell Performance and success

We are using the Universal Sentence Encoder for this use case, which is already trained for similarity, so we can solve this case without further training of the model. As a result, there will be no number to indicate how well the model performs. Labeled data is needed to quantify the performance of a similarity model, but we do not need labeled data to solve this use case. Instead, we can get an idea of how well the model is performing by using the test deployment, which you can find in the deployment view. Enable the API, click the test deployment link, run a few queries, and qualitatively evaluate your model.

Where to learn more?

Want to learn more about building an AI based search solution, check out our tutorial within the platform where you can learn how to apply text similarity.

You need some help to discuss your business case?

Contact our experienced
Sales Team now


bottom of page