{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,11,24]],"date-time":"2026-11-24T21:25:30Z","timestamp":1795555530091,"version":"4.11.0"},"reference-count":45,"publisher":"MDPI AG","issue":"12","license":[{"start":{"date-parts":[[2024,12,10]],"date-time":"2024-12-10T00:00:00Z","timestamp":1733788800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["BDCC"],"abstract":"<jats:p>This research paper presents findings from an investigation in the semantic similarity search task within the legal domain, using a corpus of 1172 Hungarian court decisions. The study establishes the groundwork for an operational semantic similarity search system designed to identify cases with comparable facts using preliminary legal fact drafts. Evaluating such systems often poses significant challenges, given the need for thorough document checks, which can be costly and limit evaluation reusability. To address this, the study employs manually created fact drafts for legal cases, enabling reliable ranking of original cases within retrieved documents and quantitative comparison of various vectorization methods. The study compares twelve different text embedding solutions (the most recent became available just a few weeks before the manuscript was written) identifying Cohere\u2019s embed-multilingual-v3.0, Beijing Academy of Artificial Intelligence\u2019s bge-m3, Jina AI\u2019s jina-embeddings-v3, OpenAI\u2019s text-embedding-3-large, and Microsoft\u2019s multilingual-e5-large models as top performers. To overcome the transformer-based models\u2019 context window limitation, we investigated chunking, striding, and last chunk scaling techniques, with last chunk scaling significantly improving embedding quality. The results suggest that the effectiveness of striding varies based on token count. Notably, employing striding with 16 tokens yielded optimal results, representing 3.125% of the context window size for the best-performing models. Results also suggested that from the models having 8192 token long context window the bge-m3 model is superior compared to jina-embeddings-v3 and text-embedding-3-large models in capturing the relevant parts of a document if the text contains significant amount of noise. The validity of the approach was evaluated and confirmed by legal experts. These insights led to an operational semantic search system for a prominent legal content provider.<\/jats:p>","DOI":"10.3390\/bdcc8120185","type":"journal-article","created":{"date-parts":[[2024,12,10]],"date-time":"2024-12-10T04:15:03Z","timestamp":1733804103000},"page":"185","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":10,"title":["From Fact Drafts to Operational Systems: Semantic Search in Legal Decisions Using Fact Drafts"],"prefix":"10.3390","volume":"8","author":[{"ORCID":"https:\/\/orcid.org\/0000-0001-8475-5969","authenticated-orcid":false,"given":"Gergely M\u00e1rk","family":"Cs\u00e1nyi","sequence":"first","affiliation":[{"name":"MONTANA Knowledge Management Ltd., H\u00e1rsalja Street 32, 1029 Budapest, Hungary"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0007-4644-9486","authenticated-orcid":false,"given":"Dorina","family":"Lakatos","sequence":"additional","affiliation":[{"name":"MONTANA Knowledge Management Ltd., H\u00e1rsalja Street 32, 1029 Budapest, Hungary"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-5897-9379","authenticated-orcid":false,"given":"Istv\u00e1n","family":"\u00dcveges","sequence":"additional","affiliation":[{"name":"MONTANA Knowledge Management Ltd., H\u00e1rsalja Street 32, 1029 Budapest, Hungary"},{"name":"HUN-REN Centre for Social Sciences, Toth Kalman Street 4, 1097 Budapest, Hungary"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-7689-9989","authenticated-orcid":false,"given":"Andrea","family":"Megyeri\u00a0","sequence":"additional","affiliation":[{"name":"Wolters Kluwer Hungary Kft., Budafoki Street 187-189, 1117 Budapest, Hungary"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-3848-6096","authenticated-orcid":false,"given":"J\u00e1nos P\u00e1l","family":"Vad\u00e1sz","sequence":"additional","affiliation":[{"name":"MONTANA Knowledge Management Ltd., H\u00e1rsalja Street 32, 1029 Budapest, Hungary"},{"name":"Institute of the Information Society, National University of Public Service, Ludovika Square 2, 1083 Budapest, Hungary"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-0467-1410","authenticated-orcid":false,"given":"D\u00e1niel","family":"Nagy","sequence":"additional","affiliation":[{"name":"MONTANA Knowledge Management Ltd., H\u00e1rsalja Street 32, 1029 Budapest, Hungary"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-2019-5349","authenticated-orcid":false,"given":"Ren\u00e1t\u00f3","family":"V\u00e1gi","sequence":"additional","affiliation":[{"name":"MONTANA Knowledge Management Ltd., H\u00e1rsalja Street 32, 1029 Budapest, Hungary"},{"name":"Wolters Kluwer Hungary Kft., Budafoki Street 187-189, 1117 Budapest, Hungary"},{"name":"Doctoral School of Law, E\u00f6tv\u00f6s Lor\u00e1nd University, Egyetem Square 1-3, 1053 Budapest, Hungary"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"1968","published-online":{"date-parts":[[2024,12,10]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","unstructured":"Cs\u00e1nyi, G.M., V\u00e1gi, R., Nagy, D., \u00dcveges, I., Vad\u00e1sz, J.P., Megyeri, A., and Orosz, T. (2022). Building a Production-Ready Multi-Label Classifier for Legal Documents with Digital-Twin-Distiller. Appl. Sci., 12.","DOI":"10.3390\/app12031470"},{"key":"ref_2","first-page":"5998","article-title":"Attention is all you need","volume":"30","author":"Vaswani","year":"2017","journal-title":"Adv. Neural Inf. Process. Syst."},{"key":"ref_3","doi-asserted-by":"crossref","first-page":"135","DOI":"10.1162\/tacl_a_00051","article-title":"Enriching word vectors with subword information","volume":"5","author":"Bojanowski","year":"2017","journal-title":"Trans. Assoc. Comput. Linguist."},{"key":"ref_4","unstructured":"Salton, G., and McGill, M.J. (1986). Introduction to Modern Information Retrieval, McGraw-Hill, Inc."},{"key":"ref_5","doi-asserted-by":"crossref","unstructured":"Qian, G., Sural, S., Gu, Y., and Pramanik, S. (2004, January 14\u201317). Similarity between Euclidean and cosine angle distance for nearest neighbor queries. Proceedings of the 2004 ACM Symposium on Applied Computing, Nicosia, Cyprus.","DOI":"10.1145\/967900.968151"},{"key":"ref_6","unstructured":"Mikolov, T., Chen, K., Corrado, G., and Dean, J. (2013). Efficient Estimation of Word Representations in Vector Space. arXiv."},{"key":"ref_7","doi-asserted-by":"crossref","first-page":"907","DOI":"10.1049\/el.2015.0108","article-title":"Check node unit for LDPC decoders based on one-hot data representation of messages","volume":"51","author":"Boncalo","year":"2015","journal-title":"Electron. Lett."},{"key":"ref_8","doi-asserted-by":"crossref","first-page":"1908","DOI":"10.1109\/TIP.2010.2045169","article-title":"Semantics-Preserving Bag-of-Words Models and Applications","volume":"19","author":"Wu","year":"2010","journal-title":"IEEE Trans. Image Process."},{"key":"ref_9","doi-asserted-by":"crossref","first-page":"118","DOI":"10.1057\/s41270-021-00109-8","article-title":"BERT: A sentiment analysis odyssey","volume":"9","author":"Alaparthi","year":"2021","journal-title":"J. Mark. Anal."},{"key":"ref_10","doi-asserted-by":"crossref","unstructured":"Pal, A., Rajanala, S., Phan, R.C.W., and Wong, K. (2023, January 4\u201310). Self Supervised Bert for Legal Text Classification. Proceedings of the ICASSP 2023\u20142023 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Rhodes Island, Greece.","DOI":"10.1109\/ICASSP49357.2023.10095308"},{"key":"ref_11","doi-asserted-by":"crossref","unstructured":"Yang, X., Yang, K., Cui, T., Chen, M., and He, L. (2022). A Study of Text Vectorization Method Combining Topic Model and Transfer Learning. Processes, 10.","DOI":"10.3390\/pr10020350"},{"key":"ref_12","unstructured":"Devlin, J., Chang, M.W., Lee, K., and Toutanova, K. (2018). Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv."},{"key":"ref_13","doi-asserted-by":"crossref","first-page":"963","DOI":"10.1007\/s40747-023-01192-3","article-title":"An efficient long-text semantic retrieval approach via utilizing presentation learning on short-text","volume":"10","author":"Wang","year":"2023","journal-title":"Complex Intell. Syst."},{"key":"ref_14","doi-asserted-by":"crossref","unstructured":"Limsopatham, N. (2021). Effectively leveraging BERT for legal document classification. Proceedings of the Natural Legal Language Processing Workshop 2021, Association for Computational Linguistics.","DOI":"10.18653\/v1\/2021.nllp-1.22"},{"key":"ref_15","first-page":"17283","article-title":"Big bird: Transformers for longer sequences","volume":"33","author":"Zaheer","year":"2020","journal-title":"Adv. Neural Inf. Process. Syst."},{"key":"ref_16","unstructured":"Beltagy, I., Peters, M.E., and Cohan, A. (2020). Longformer: The Long-Document Transformer. arXiv."},{"key":"ref_17","doi-asserted-by":"crossref","unstructured":"Vatsal, S., Meyers, A., and Ortega, J. (2023). Classification of US Supreme Court Cases using BERT-Based Techniques. arXiv.","DOI":"10.26615\/978-954-452-092-2_128"},{"key":"ref_18","unstructured":"Dong, Z., Tang, T., Li, L., and Zhao, W.X. (2023). A survey on long text modeling with transformers. arXiv."},{"key":"ref_19","unstructured":"Wan, X., and Yang, J. (2005, January 13\u201315). Document similarity search based on generic summaries. Proceedings of the Information Retrieval Technology: Second Asia Information Retrieval Symposium, AIRS 2005, Jeju Island, Republic of Korea. Proceedings 2."},{"key":"ref_20","doi-asserted-by":"crossref","first-page":"145","DOI":"10.1007\/s12626-024-00157-3","article-title":"NOWJ at COLIEE 2023: Multi-task and Ensemble Approaches in Legal Information Processing","volume":"18","author":"Vuong","year":"2024","journal-title":"Rev. Socionetwork Strateg."},{"key":"ref_21","first-page":"405","article-title":"Case Study for Measuring the Feasibility of a Semantic Search System","volume":"7","year":"2012","journal-title":"Mil. Eng."},{"key":"ref_22","doi-asserted-by":"crossref","first-page":"38","DOI":"10.2478\/acss-2019-0006","article-title":"A semantic retrieval system for case law","volume":"24","author":"Ebietomere","year":"2019","journal-title":"Appl. Comput. Syst."},{"key":"ref_23","doi-asserted-by":"crossref","unstructured":"\u0160avelka, J., and Ashley, K.D. (2022). Legal information retrieval for understanding statutory terms. Artificial Intelligence and Law, Springer.","DOI":"10.1007\/s10506-021-09293-5"},{"key":"ref_24","doi-asserted-by":"crossref","first-page":"397","DOI":"10.1007\/s10506-023-09354-x","article-title":"Semantic matching based legal information retrieval system for COVID-19 pandemic","volume":"32","author":"Zhu","year":"2024","journal-title":"Artif. Intell. Law"},{"key":"ref_25","doi-asserted-by":"crossref","unstructured":"Reimers, N., and Gurevych, I. (2019). Sentence-bert: Sentence embeddings using siamese bert-networks. arXiv.","DOI":"10.18653\/v1\/D19-1410"},{"key":"ref_26","doi-asserted-by":"crossref","unstructured":"Louis, A., van Dijck, G., and Spanakis, G. (2024, January 20\u201327). Interpretable long-form legal question answering with retrieval-augmented large language models. Proceedings of the AAAI Conference on Artificial Intelligence, Vancouver, BC, Canada.","DOI":"10.1609\/aaai.v38i20.30232"},{"key":"ref_27","doi-asserted-by":"crossref","unstructured":"Martin, L., Muller, B., Su\u00e1rez, P.J.O., Dupont, Y., Romary, L., de La Clergerie, \u00c9.V., Seddah, D., and Sagot, B. (2019). CamemBERT: A tasty French language model. arXiv.","DOI":"10.18653\/v1\/2020.acl-main.645"},{"key":"ref_28","first-page":"2511147","article-title":"BERT_LF: A similar case retrieval method based on legal facts","volume":"2022","author":"Hu","year":"2022","journal-title":"Wirel. Commun. Mob. Comput."},{"key":"ref_29","doi-asserted-by":"crossref","unstructured":"Shao, Y., Mao, J., Liu, Y., Ma, W., Satoh, K., Zhang, M., and Ma, S. (2020, January 7\u201315). BERT-PLI: Modeling paragraph-level interactions for legal case retrieval. Proceedings of the IJCAI, Yokohama, Japan.","DOI":"10.24963\/ijcai.2020\/484"},{"key":"ref_30","doi-asserted-by":"crossref","unstructured":"Ma, Y., Shao, Y., Wu, Y., Liu, Y., Zhang, R., Zhang, M., and Ma, S. (2021, January 11\u201315). LeCaRD: A legal case retrieval dataset for Chinese law system. Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, Online.","DOI":"10.1145\/3404835.3463250"},{"key":"ref_31","unstructured":"Wang, L., Yang, N., Huang, X., Yang, L., Majumder, R., and Wei, F. (2024). Multilingual E5 Text Embeddings: A Technical Report. arXiv."},{"key":"ref_32","doi-asserted-by":"crossref","unstructured":"Chen, J., Xiao, S., Zhang, P., Luo, K., Lian, D., and Liu, Z. (2024). BGE M3-Embedding: Multi-Lingual, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation. arXiv.","DOI":"10.18653\/v1\/2024.findings-acl.137"},{"key":"ref_33","unstructured":"Sturua, S., Mohr, I., Akram, M.K., G\u00fcnther, M., Wang, B., Krimmel, M., Wang, F., Mastrapas, G., Koukounas, A., and Wang, N. (2024). jina-embeddings-v3: Multilingual Embeddings With Task LoRA. arXiv."},{"key":"ref_34","unstructured":"Cs\u00e1nyi, G.M., V\u00e1gi, R., Gad\u00f3, K., \u00dcveges, I., Nagy, D., Baj\u00e1ri, L., Megyeri, A., F\u00fcl\u00f6p, A., and Vad\u00e1sz, J.P. (Mach. Learn. Knowl. Extr., 2024). Building a Production-ready, Hierarchical Subject Matter Classifier for Legal Decisions, Mach. Learn. Knowl. Extr., Under review."},{"key":"ref_35","doi-asserted-by":"crossref","first-page":"153","DOI":"10.12700\/APH.20.7.2023.7.9","article-title":"Analyzing Narratives of Patient Experiences: A BERT Topic Modeling Approach","volume":"20","author":"Yang","year":"2023","journal-title":"Acta Polytech. Hung."},{"key":"ref_36","unstructured":"Nemeskey, D.M. (2021, January 28\u201329). Introducing huBERT. Proceedings of the XVII. Magyar Sz\u00e1m\u00edt\u00f3g\u00e9pes Nyelv\u00e9szeti Konferencia (MSZNY2021), Szeged, Hungary."},{"key":"ref_37","doi-asserted-by":"crossref","unstructured":"Muennighoff, N., Tazi, N., Magne, L., and Reimers, N. (2022). MTEB: Massive text embedding benchmark. arXiv.","DOI":"10.18653\/v1\/2023.eacl-main.148"},{"key":"ref_38","unstructured":"Izacard, G., Caron, M., Hosseini, L., Riedel, S., Bojanowski, P., Joulin, A., and Grave, E. (2021). Unsupervised dense information retrieval with contrastive learning. arXiv."},{"key":"ref_39","first-page":"3111","article-title":"Distributed representations of words and phrases and their compositionality","volume":"26","author":"Mikolov","year":"2013","journal-title":"Adv. Neural Inf. Process. Syst."},{"key":"ref_40","first-page":"247","article-title":"Parallel corpora for medium density languages","volume":"292","author":"Varga","year":"2007","journal-title":"Amst. Stud. Theory Hist. Linguist. Sci. Ser. 4"},{"key":"ref_41","unstructured":"Bajaj, P., Campos, D., Craswell, N., Deng, L., Gao, J., Liu, X., Majumder, R., McNamara, A., Mitra, B., and Nguyen, T. (2016). Ms marco: A human generated machine reading comprehension dataset. arXiv."},{"key":"ref_42","unstructured":"Wenzek, G., Lachaux, M.A., Conneau, A., Chaudhary, V., Guzm\u00e1n, F., Joulin, A., and Grave, E. (2019). CCNet: Extracting high quality monolingual datasets from web crawl data. arXiv."},{"key":"ref_43","doi-asserted-by":"crossref","unstructured":"Conneau, A., Khandelwal, K., Goyal, N., Chaudhary, V., Wenzek, G., Guzm\u00e1n, F., Grave, E., Ott, M., Zettlemoyer, L., and Stoyanov, V. (2019). Unsupervised cross-lingual representation learning at scale. arXiv.","DOI":"10.18653\/v1\/2020.acl-main.747"},{"key":"ref_44","unstructured":"Wang, L., Yang, N., Huang, X., Jiao, B., Yang, L., Jiang, D., Majumder, R., and Wei, F. (2022). Text embeddings by weakly-supervised contrastive pre-training. arXiv."},{"key":"ref_45","first-page":"30233","article-title":"Matryoshka representation learning","volume":"35","author":"Kusupati","year":"2022","journal-title":"Adv. Neural Inf. Process. Syst."}],"container-title":["Big Data and Cognitive Computing"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2504-2289\/8\/12\/185\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,10]],"date-time":"2025-10-10T16:51:12Z","timestamp":1760115072000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2504-2289\/8\/12\/185"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2024,12,10]]},"references-count":45,"journal-issue":{"issue":"12","published-online":{"date-parts":[[2024,12]]}},"alternative-id":["bdcc8120185"],"URL":"https:\/\/doi.org\/10.3390\/bdcc8120185","relation":{},"ISSN":["2504-2289"],"issn-type":[{"value":"2504-2289","type":"electronic"}],"subject":[],"published":{"date-parts":[[2024,12,10]]}}}