msbayindir

Research · Turkish NLP

Turkish Legal Language Models

Sentence similarity and masked language models I fine-tuned for Turkish legal texts and published on Hugging Face.

Research
  • BERTurk
  • XLM-RoBERTa
  • Sentence Transformers
  • Hugging Face
23,103 training pairs
Legal STS-B training split
768 dimensions
Vector size of the published sentence encoders
0.9688 Spearman
BERTurk STS model result on sts-test

Technical walkthrough

Semantic similarity

I trained Sentence Transformers models to turn legal sentences and paragraphs into vectors. These vectors can help find similar texts and rank candidate passages in a document search system.

Masked language modeling

The Turkish BERT and XLM-RoBERTa models predict masked text from its surrounding context. The Hugging Face cards list these models as Fill-Mask and the vector-producing models as Sentence Similarity.

Evaluation

The BERTurk STS model card reports Pearson 0.9701 and Spearman 0.9688 on sts-test. The other embedding model reports Pearson 0.9287 and Spearman 0.9262 on tr-dev. The figures come from different splits and measure sentence similarity. Document retrieval and answer accuracy require their own tests.

Turkish legal NLP: BERT embeddings and Gemma 4 fine-tuning