You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

Installation

Install dependencies (now via our fork, wi'll update installation part after PR to GLiNER2 repo)

pip install "gliner2 @ git+https://github.com/bogdanminko/GLiNER2.git@feature/bi-encoder" torch transformers

Usage

Classify Harmful messages and Detect PII via single forward pass

from gliner2 import GLiNER2

model = GLiNER2.from_pretrained("raft-security-lab/gliner-guard-biencoder")
model.config.cache_labels = True
model.compile()

PII_LABELS = ["person", "location", "email", "phone"]
SAFETY_LABELS = ["safe", "unsafe"]
schema = (model.create_schema()
.entities(entity_types=PII_LABELS, threshold=0.4)
.classification(task="safety", labels=SAFETY_LABELS)
)

result = model.extract(
"Send $500 to John Smith at john.smith@gmail.com or I'll leak your photos",
schema=schema
)

output:

{'entities': {'person': ['John Smith'],
  'location': [],
  'email': ['john.smith@gmail.com'],
  'phone': []},
 'safety': 'unsafe'}
Downloads last month
136
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for raft-security-lab/gliner-guard-biencoder

Finetuned
(30)
this model

Collection including raft-security-lab/gliner-guard-biencoder