AI-POWERED LEGAL OPINION AND RECOMMENDATION SYSTEM

The system addresses the challenge of structuring legal questions from unstructured email by cleaning and analyzing content to create structured legal questions, leveraging large language models for integrating past legal knowledge and drafting new opinions.

TR202616504A2Pending Publication Date: 2026-10-21TURKCELL TEKNOLOJI ARASTIRMA & GELISTIRME AS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
TR202616504
Authority / Receiving Office
TR · TR
Patent Type
Applications
Current Assignee / Owner
Filing Date
2026-09-24
Publication Date
2026-10-21

Smart Images

  • Figure 00000014_0000
    Figure 00000014_0000
Patent Text Reader

Abstract

This invention relates to a system (1) that enables the automatic extraction of legal issues from unstructured legal texts transmitted via electronic devices, the determination of past legal opinions through semantic similarity analysis, the creation of a draft of a new legal opinion using the determined past legal opinions, and the presentation of past legal opinions related to the created opinion to the user.
Need to check novelty before this filing date? Find Prior Art

Description

1 TARIFF AI-POWERED LEGAL OPINION AND RECOMMENDATION SYSTEM Technical Area 5 This invention derives legal questions semantically from unstructured texts. Identifying similar past legal opinions, and examining those past opinions reuse, new legal opinions based on past views the drafting and the creation of a legal opinion, along with past legal reviews. It relates to a system that allows opinions to be presented to the user together. Previous Technique Today, a significant portion of legal advice requests in corporate structures are from 15-year-olds. through email, electronic documents and other unstructured texts These communications contain multiple references to the same legal subject. email, reply, forwarding, signature information, date information, and previous correspondence The content can be found together. Therefore, the request for legal advice... If transferred directly to an AI-based system, the legal problem becomes 20 content that is not directly related to the main information or the legal problem. They need to be separated from each other. In the current technique, with the large language model... Although there are inventions that provide answers to legal questions, they are non-structural. automatic extraction of the legal issue from the email chain, word The subject of this question has been answered previously in the same or similar legal opinions. 25 comparison, reuse of past institutional legal knowledge. And as a result of the same process, both a new legal opinion and relevant past opinions are obtained. The integrated structure in which it is presented to the user is limited. Therefore, structural the automatic inference of the legal issue from non-existent texts, the inference matching the legal issue with relevant opinions from past legal opinions. 30 2 and a new legal opinion based on that accumulated past knowledge. An integrated technical solution is needed to enable its creation. The results of the research are based on the current state of the art. Patent document number WO2025085566A1 describes AI-powered legal systems. The text discusses a research and feedback-based content production system. legal research entered by the user in natural language in the patent document taking into account the criteria, and based on those criteria, on legal documents performing searches and obtaining a large linguistic model of legal documents. The analysis and content creation processes using this data are explained. 10 However, the legal aspects of the studies in question, which are included in the current technique, Research or general-purpose content creation with retrieving artificial intelligence. Although it is possible to do so, from unstructured email chains the automatic derivation of the legal question directly, the derived legal question 15 Comparison with established institutional legal opinions in the past, past perspectives are identified for the purpose of information reuse, and the same process is applied. As a result, both a draft of a new legal opinion and the new opinion itself. a compilation of the most relevant historical legal opinions used in its formation It is assessed that there is no such process flow. 20 Brief Description of the Invention The aim of this invention is to extract unstructured text, especially from email. the automatic removal of the legal problem from the chains and the resulting 25 semantic similarity of legal opinions formed in the past regarding the legal question The goal is to create a system that enables identification based on its fundamental principles. Another purpose of the invention is to analyze HTML tags and signatures found within emails. blocks, repetitive correspondence, and similar content that lacks semantic value 30 The goal is to clean the text and obtain a suitable environment for AI-based analysis. 3 Another purpose of the invention is to process the cleaned email content into a large language model. By analyzing it through this medium, the legal problem expressed in the correspondence can be summarized. The goal is to transform it into a clear and structured legal question. Detailed Description of the Invention The purpose of this invention is to achieve "AI-Powered Legal". The "Feedback and Suggestion System" is shown in the attached document; Figure 1 shows a schematic view of the system that is the subject of the invention. The parts shown in the figure are individually numbered, and the corresponding numbers correspond to these numbers. given below: 1. System 2. Electronic device 3. Database 4. Server Extracting legal issues from unstructured texts, past legal records to identify opinions and to use those opinions to develop new legal frameworks. system that enables the formation of opinion (1); - User-generated email content for legal advice 25 that enables the receipt and viewing of requests and legal opinions. at least one electronic device configured to provide an interface (2), - past legal opinions, legal questions, question-and-answer records, documents to record parts, vector representations and user operation information at least one database structured to (3), - to exchange data with electronic devices (2) and databases (3), 30 Receiving legal advice requests consisting of unstructured texts, 4 to process unstructured texts received from electronic devices (2), HTML cleaning up content and textual noise, cleaned email extracting the legal question from the content, representing the legal question as a vector. transforming, semantically and textually, past legal opinions. Identifying records with similarities, re-evaluating the identified results. 5 to list, to reconstruct relevant past legal opinions, past to generate a new draft legal opinion using the opinions and relevant past to transmit opinions to the user on the electronic device (2) It includes at least one configured server (4). In the system that is the subject of the invention (1) electronic device (2), smartphone, tablet computer, It is a device similar to a desktop computer or a portable computer. The one in question... electronic device (2), any remote communication device in the known state of the art to establish a connection with the server (4) using the protocol and this established connection It is configured to exchange data with the server (4) via 15 In the preferred application of the invention, the electronic device (2) server (4) and data bus to exchange data using the Internet is structured. Electronic device (2), legal advice by the user. the entry of the request, the generated email content, legal advice a 20 that enables the collection and viewing of requests and legal opinions. It is configured to provide an interface. In the system that is the subject of the invention, legal information is obtained through the database (3) and electronic device (2). Consultancy requests, unstructured texts, email content, Cleaned-up texts, removed legal questions, past legal questions and answers 25 records, past legal opinions, document information related to legal opinions, document fragments, document IDs, text embedding results generated vector representations, search results, relevance scores, metadata information and new draft legal opinions presented to the user, as well as past legal opinions. It is structured to record information regarding opinions. 30 The server (4) in the system (1) which is the subject of the invention, the data on the database (3) It is configured to access and save data onto the database (3). Legal information transmitted by the user via the server (4) electronic device (2) to receive the consultation request and the unstructured legal text, and the legal information received. the email contents and texts included in the consultation request, 5 Directed correspondence, email signatures, hypertext markup language (HTML) formatting and similar unstructured content It is structured. The server (4) receives unstructured data from the electronic device (2). Extracting HTML tags from legal texts, removing unnecessary emails. Filter out signatures and citation chains and convert the text into simplified plain text. 10 It is configured to bring. The server (4) is configured to bring HTML format within this scope. parsing the content and identifying those elements within the content that do not contribute to legal interpretation. removing structural components, extracting the actual text content, and within the text... To convert HTML characters to standard characters. is configured. Server (4) line breaks, tabs and similar formatting 15 by organizing source characters to unify consecutive spaces It is structured. The server (4) receives legal information via electronic device (2). The text is first parsed using the Document Object Model Parsing algorithm. It is configured to parse the received texts. The server (4) parses the received texts of noise. Applying a noise reduction algorithm and then converting the text to plain text 20 by transforming and processing with the text normalization algorithm It is configured to make it suitable. The server (4) cleans the text By analyzing the legal advice request using the Big Language Model, a single legal body can handle the process. Legal question summarization algorithm to convert into a legal question The server (4) is configured to use (Summarization). The process type is 25 by preserving the contract terms, dates, party information and legal references. It is configured to filter out unnecessary content. The server (4), history SHA-256 hash algorithm used during the recording of legal questions and answers. Generating hash values ​​of records using SHA-256 hashing and sorting duplicate records. It is configured to extract. The server (4) iteratively extracts the historical records 30 with recursive sentence-based chunking algorithm 6 It is configured to divide into tokens according to the token limits. Server (4), Text embedding in Turkish texts using the BAAI BGE-M3 tokenization algorithm. In English texts, the semantic features of the texts are represented by numerical vector representations. transforming text embedding model (Qwen3-Embedding-0.6B) algorithm It is configured to use. The server (4) provides a summary title for each piece of text. 5 to create and use document title, part content and metadata information to generate vector representation using text embedding algorithm The server (4) is configured within the database (3) of the generated vectors. to store with a hierarchical navigable tiny world (HNSW) index It is structured. The server (4) uses past legal 10 legal questions to create the legal question. Searching among opinions using the semantic search algorithm with cosine It is configured to use the cosine similarity algorithm. Server (4), Full-Text Search algorithm with cosine algorithm with tsvector (text vector) and ts_rank (text suitability ranking) mechanisms It is configured to determine the first fifteen results using. Server (4), two 15 combining the search results using a result fusion algorithm and It is configured to prioritize semantic search results. Server (4), The combined results are reordered using the cross-encoder reordering algorithm (Cross- Text reranking model with Encoder Reranking (BGE Reranker v2-m3) using 20 to reorder and filter according to relevance threshold. It is configured. Server (4) gives the highest score when the threshold is not met. to protect and reorder up to five unique document IDs from the results. It is configured to determine the documents created. The server (4) contains these documents. Recreate the document by retrieving all parts from the database (3) The algorithm (Document Reconstruction) analyzes past legal question-and-answer records. It is configured to recreate the history created. The server (4) transferring legal opinions into a large language model in numbered entries and with the retrieval-augmented generation (RAG) method It is structured to create a new legal opinion draft. Server (4), request When there is insufficient information on the subject, this should be stated, and more than one 30 It is structured to unify the source into a single consistent view. Server (4), 7 Request for legal advice: Prompt Injection Detection Algorithm Checking with (Detection) and overriding the user prompt, output if manipulation or an attempt to extract requested information is detected The process is configured to stop and return a safe default response. The server (4) presented the draft of the new legal opinion and the five most relevant past legal opinions. transmitting the opinion, document and metadata information to the electronic device (2) It is structured to perform data cleaning, question summarization, information retrieval. The server (4) is structured to perform data cleaning, question summarization, information retrieval. The institution controls the processes of retrieval, vision generation, and request injection. to be performed in an indoor environment and GPT-OSS-120B, Qwen3-Next-80B-A3B, BAAI The BGE-M3, Qwen3-Embedding-0.6B and BGE Reranker v2-m3 models can be purchased externally on a 10 The server is configured to run without interface (API) dependency. (4), legal claim, legal question raised, past opinions, text fragments, vector representations, search results, metadata information, and a new opinion draft. It is configured to save to the database (3). Industrial application of the invention In the system covered by the invention (1), the user can act through an electronic device (2) legal advice request or unstructured legal text transmitted to the server (4) is transmitted. The server (4) converts the received text into HTML tags, email signatures and 20 It cleans the text by removing quotation marks and prepares it for legal question summarization. It makes it suitable. The cleaned text is analyzed and used for email or legal purposes. The request for legal advice within the text is a single, structured legal request. It is transformed into a question. The legal question created, past legal questions and answers. Search within the records. Server (4), semantic search and full text search 25 by combining their methods, past legal opinions similar to the legal question It determines. The results obtained are rearranged to identify the most relevant results, and the most relevant ones are determined. Up to 5 unique historical legal documents are selected. Text from the selected documents. By piecing together the fragments, past legal question and answer records are reconstructed. 8 Thanks to the system (1) which is the subject of the invention, legal texts can be derived from unstructured legal texts. the automatic extraction of the problem, semantically interpreting past legal opinions finding, reusing past legal knowledge and past drafting a new legal opinion, taking into account the opinions. is provided. 5 Around these fundamental concepts, the subject of the invention is "Artificial Intelligence-Powered Legal Opinion". It is possible to develop a wide variety of applications related to the "Suggestion System (1)", The invention cannot be limited to the examples described here, but mainly to the claims. as stated. 10

Claims

9 REQUESTS 1. Extracting legal issues from unstructured texts, past legal records. identifying opinions and using those opinions to develop new ones 5 that enable the formation of legal opinions. User-generated email content for legal advice. a system that allows requests and legal opinions to be obtained and viewed at least one electronic device configured to provide an interface (2), past legal opinions, legal questions, question-and-answer records, documents 10. To record parts, vector representations, and user operation information. at least one database structured to (3) and to exchange data with electronic devices (2) and databases (3); processing unstructured text received from electronic devices, HTML cleaning up content and textual noise, cleaned email Extracting the legal question from the content, representing the legal question as a vector. 15 transforming, semantically and textually, past legal opinions. to identify records with similarities, to re-evaluate the identified results to list, to reconstruct relevant past legal opinions, past to generate a new draft legal opinion using the opinions and relevant past to transmit opinions to the user on the electronic device (2) 20 a system characterized by having at least one server (4) configured (1).

2. Entering the legal advice request submitted by the user, the email content created, requests for legal advice, and legal matters to provide an interface that allows opinions to be gathered and viewed 25 as in Claim 1 characterized by the configured electronic device (2) a system (1).

3. Legal advice requests received via electronic device (2), unstructured text, email content, cleaned 30 texts, extracted legal questions, past legal questions and answers records, past legal opinions, documents relating to legal opinions information, document fragments, document IDs, text embedding vector representations generated as a result of the process, search results, relevance scores, metadata information, and new legal opinions provided to the user.

5. To record drafts and information regarding past legal opinions. Claim 1 or 2 characterized by the database structured as (3) such a system (1).

4. Legal information transmitted by the user via electronic device (2) the consultation request, receiving the unstructured legal text and the received legal 10 the email contents included in the consultancy request, texts, redirected correspondence, email signatures, HTML to process formatting and similar unstructured content from the above requests characterized by the configured server (4) a system like any other (1). 15 5. Unstructured legal text obtained from an electronic device (2) Extracting HTML tags, removing unnecessary email signatures and quotes filtering the chains and simplified the text into plain text and within this scope, parsing the content in HTML format, 20 and removing structural components that do not contribute to legal interpretation, extracting the original text content and extracting HTML characters from the text with server (4) configured to convert to standard characters a system like any of the above characterized claims (1). 25 6. Line breaks, tabs, and similar formatting characters. by arranging consecutive gaps to singularize electronic devices (2) The legal text obtained from it is first parsed using the document object model. parsing with the algorithm and noise pruning algorithm 30 of the received texts text normalization involves applying and then converting the text to plain text. 11 to make it suitable for processing with the algorithm with the server (4) a system like any of the above characterized claims (1).

7. Analyze the cleaned text using a large language model and legal 5 Summarize the request for consultation by expressing it in a way that includes a single legal question. to run a structured legal question summarization algorithm; word The subject of the summary includes the type of transaction, contract terms, dates, and parties involved. legally significant elements such as information and legislative references protecting and removing unnecessary content; past legal questions and answers 10 A SHA-256 hash is generated for each record during the data entry process. to generate a cryptographic hash value using the algorithm and the generated To identify and eliminate duplicate records by comparing summary values. from the above requests characterized by the configured server (4) a system like any other (1). 15 8. Tokens are extracted from historical records using a recursive sentence-based splitting algorithm. to divide into parts according to its boundaries and in Turkish texts BAAI BGE-M3 The tokenizer, in English texts, is Qwen3-Embedding-0.6B tokenizer. The above 20 is characterized by the server (4) configured for use. a system like any of the requests (1).

9. Create a summary title for each piece of text and include the document title and the piece title. text embedding algorithm using content and metadata information to generate vector representations and the generated vectors are in the database (3) 25 Characterized by the server (4) configured to store with the HNSW index. a system like any of the above-mentioned requests (1).

10. To search for the legal question posed among past legal opinions. Using a semantic search algorithm and a cosine similarity algorithm, 30 cosine algorithm and full-text search algorithm with tsvector / ts_rank 12 using mechanisms to determine the first fifteen results and two searches combining the results with a result merging algorithm and semantic search characterized by the server (4) configured to prioritize results a system like any of the above-mentioned requests (1).

11. Combined results using cross-encoder reranking with BGE Reranker Reordering using v2-m3, filtering according to relevance threshold, and If the threshold is not met, it will retain the highest score and re-evaluate. Select up to 5 unique document IDs from the listed results. 10 of the above requests characterized by the server (4) configured to do so. a system like any other (1).

12. All parts of these created documents are transferred to the database (3). by recreating the document using an algorithm, past legal questions- to recreate the response records and the historical legal records created 15 The views are presented as numbered entries within the context of the large language model. to convey and bring information through a production method and new legal perspective characterized by the server (4) configured to create the draft a system like any of the above requests (1).

13. To state when there is insufficient information available on the requested topic and combining multiple sources into a single, consistent opinion, legal advice. to check the request with a request injection detection algorithm and the user invalidation of the request, manipulation of the output, or distortion of the request information. If an attempt to remove the device is detected, the process will be stopped and secured. 25 Characterized by the server (4) configured to return the default response. a system like any of the above-mentioned requests (1).

14. The newly created draft legal opinion and the five most relevant past legal opinions. the opinion, document and metadata information together with the electronic device (2) 30 transmitting, data cleaning, question summarizing, retrieval, opinion generation, and requesting. 13 to perform injection control processes in-house and GPT-OSS-120B, Qwen3-Next-80B-A3B, BAAI BGE-M3, Qwen3- Embedding-0.6B and BGE Reranker v2-m3 models use external APIs. with server (4) configured to run without dependency A system like any of the above characterized claims 5 (1).

15. Legal claim, the legal question raised, past opinions, text parts, vector representations, search results, metadata information, and 10 configured to save the new opinion draft onto the database (3) any of the above requests characterized by the server (4) such a system (1). 20 30