Views
No views yet

1from transformers import AutoModel, AutoTokenizer
2model = AutoModel.from_pretrained("AnnaStudy/LEXA-8B", torch_dtype="auto", device_map="auto")
3tokenizer = AutoTokenizer.from_pretrained("AnnaStudy/LEXA-8B")
4case_txt = "The following contains key components of a legal case. Legal facts..."
5tokenized = tokenizer(case_txt, return_tensors='pt', padding=True, truncation=True, max_length=2048)
6outputs = model(**tokenized)
7case_embedding = outputs.last_hidden_state[:, -1]@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}
}