Model Card for Model ID
Model Details
Model Description
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
- Developed by: Ehsan Shareghi, Jiuzhou Han, Paul Burgess
- Model type: 7B
- Language(s) (NLP): English
- License: CC BY 4.0
- Finetuned from model: Saul-7B-Base
Model Sources
Uses
Here's how you can run the model:
# pip install git+https://github.com/huggingface/transformers.git
# pip install git+https://github.com/huggingface/peft.git
import torch
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
BitsAndBytesConfig
)
from peft import PeftModel
model = AutoModelForCausalLM.from_pretrained(
"Equall/Saul-7B-Base",
quantization_config=BitsAndBytesConfig(load_in_8bit=True),
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("Equall/Saul-7B-Base")
tokenizer.pad_token = tokenizer.eos_token
model = PeftModel.from_pretrained(
model,
"auslawbench/Re-ranker-SaulLM-7B",
device_map="auto",
torch_dtype=torch.bfloat16,
)
model.eval()
fine_tuned_prompt = """
### Instruction:
{}
### Input:
{}
### Response:
{}"""
example_input="\nText:\nMany of ZAR’s grounds of appeal related to fact finding. Drawing on principles set down in several other courts and tribunals, the Appeal Panel summarised the circumstances in which leave may be granted for a person to appeal from findings of fact: <CASENAME> at [84].\n\nPotential Citations:\n\nZNX v ZNY [2020] NSWCATAP 41\nCitation Reasons: The case ZNX v ZNY [2020] NSWCATAP 41 is cited to emphasize that the Appeal Panel's role does not include drafting grounds of appeal for an unrepresented appellant.\n\nCollins v Urban [2014] NSWCATAP 17\nCitation Reasons: The cited case, , is referenced to illustrate the principles guiding the consideration of whether leave to appeal should be granted when there are issues with a fact-finding exercise.\n\nSchwartz Family Co Pty Ltd v Capitol Carpets Pty Ltd [2017] NSWCA 223\nCitation Reasons: The cited case is referenced to emphasize the necessity of explicitly identifying the grounds of appeal, particularly in the context of an error of law in judicial review applications.\n\nNavazi v New South Wales Land and Housing Corporation [2015] NSWCA 308\nCitation Reasons: The case Navazi v New South Wales Land and Housing Corporation [2015] NSWCA 308 is cited to illustrate that the existence of a right of appeal can lead to discretionary considerations in judicial review.\n\nLloyd v Veterinary Surgeons Investigating Committee [2005] NSWCA 456\nCitation Reasons: The case of Lloyd v Veterinary Surgeons Investigating Committee is cited to illustrate that the Appeal Panel has the discretion to grant leave for appeals on questions of fact, regardless of whether an error of law has been identified.\n"
model_input = fine_tuned_prompt.format("Predict the citation in the text.", example_input, '')
inputs = tokenizer(model_input, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=256, temperature=1.0)
output = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(output.split("### Response:")[1].strip().split('>')[0] + '>')
Citation
BibTeX:
@misc{shareghi2024auslawcite,
title={Methods for Legal Citation Prediction in the Age of LLMs: An Australian Law Case Study},
author={Ehsan Shareghi, Jiuzhou Han, Paul Burgess},
year={2024},
eprint={arXiv:2412.06272},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support
Model tree for auslawbench/Re-ranker-SaulLM-7B
Base model
Equall/Saul-7B-Base