Dedicated Endpoints

Run this model inference on single tenant GPU with unmatched speed and reliability at scale.

Learn more
Container

Run this model inference with full control and performance in your environment.

Learn more

Get help setting up a custom Dedicated Endpoints.

Talk with our engineer to get a quote for reserved GPU instances with discounts.

README

License: mit

Model Summary

This is the LoRA adapter for the Phi-3.5 Mini Instruct model fine-tuned to extract structured RDF knowledge graph triples from UK government procurement contract text.

For the full merged model ready for inference, use: 👉 BSVGK/phi35-mini-lora-text2kg-merged

Key Results

MetricScore
F1 Score0.9954
BERTScore F10.9997
Hallucination Rate0.00% (Zero)
Test Contracts1,387 unseen contracts

Model Details

  • Base Model: microsoft/Phi-3.5-mini-instruct
  • Adapter Type: LoRA (Low-Rank Adaptation)
  • Task: Text-to-KG — RDF triple extraction from contract text
  • Domain: UK Government Procurement Contracts
  • Training Dataset: 9,244 verified UK contracts
  • Hardware: NVIDIA A100
  • Framework: PyTorch, Hugging Face PEFT, TRL, SFTTrainer

Usage

python

from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"microsoft/Phi-3.5-mini-instruct"
)
tokenizer = AutoTokenizer.from_pretrained(
"microsoft/Phi-3.5-mini-instruct"
)
# Load LoRA adapter
model = PeftModel.from_pretrained(
base_model,
"BSVGK/phi35-mini-lora-text2kg-adapter"
)
prompt = """Extract RDF triples from the following UK government contract:
Contract: [paste your contract text here]
RDF Triples:"""
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Model provider

BSVGK

Model tree

Base

microsoft/Phi-3.5-mini-instruct

Adapter

this model

Modalities

Input

Text

Output

Text

Pricing

Dedicated Endpoints

View details

Supported Functionality

Model APIs

Dedicated Endpoints

Container

More information

Explore FriendliAI today