File size: 1,397 Bytes
ace1ce9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---

license: apache-2.0
language:
- en
base_model:
- Qwen/Qwen3-Embedding-8B
---

## LEXA-8B
👉 **LEXA-8B**: LEXA: Legal Case Retrieval via Graph Contrastive Learning with Contextualised LLM Embeddings. More information is available in [**arXiv**](https://arxiv.org/abs/2405.11791) & [**GitHub**](https://github.com/yanran-tang/CaseGNN).

## Example Usage

```python

from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("AnnaStudy/LEXA-8B", torch_dtype="auto", device_map="auto")

tokenizer = AutoTokenizer.from_pretrained("AnnaStudy/LEXA-8B")

case_txt = "The following contains key components of a legal case. Legal facts..."

tokenized = tokenizer(case_txt, return_tensors='pt', padding=True, truncation=True, max_length=2048)

outputs = model(**tokenized)

case_embedding = outputs.last_hidden_state[:, -1]

```
## Base Model

ReaKase-8B is finetuned from **Qwen3-Embedding-8B**, which provides the underlying semantic representation capability.

Reference: [Qwen/Qwen3-Embedding-8B](https://huggingface.co/Qwen/Qwen3-Embedding-8B)

## Cite
If you find this repo useful, please cite
```

@article

{LEXA-8B,

author = {Yanran Tang, Ruihong Qiu, Xue Li, Zi Huang},

title = {LEXA: Legal Case Retrieval via Graph Contrastive Learning with Contextualised LLM Embeddings},

journal = {CoRR},

volume = {abs/2405.11791},

year = {2025}

}

```