The article presents a method for comparing text documents, which is based on the construction and comparison of the corresponding semantic networks. This technique can become the basis for building systems for comparing legal documents in the framework of parliamentary control. An algorithm for constructing semantic networks as one of the types of ontologies is also considered. This algorithm can also be used in systems for automated summarizing legal information in order to generate concise information-rich reports, brief annotations or digests. The proposed technique can be used in processing queries during information retrieval, providing the ability to determine the degree of similarity or difference in the structure and semantics of texts.