Downloads · 30 days
0
Bnaad/PARENT_bert
PARENT_bert is a text classification model from Bnaad. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This repository contains TorchScript versions of 15 fine-tuned BERT models used in the PARENT project to analyse mobile app privacy policies. These models identify what data is collected, why it is collected, and how…
Downloads · 30 days
0
Access
Public
Updated Aug 22, 2025
Repo size
19.7 GB
Likes
0
Public
Click a slice to open those files.
.zip6.6 GB · 50%
From the Hugging Face model README
This repository contains TorchScript versions of 15 fine-tuned BERT models used in the PARENT project to analyse mobile app privacy policies. These models identify what data is collected, why it is collected, and how it is processed, helping assess GDPR compliance.
They are part of a hybrid framework designed for non-technical users, particularly parents concerned about children’s privacy.
import torch
from transformers import BertTokenizerFast
from huggingface_hub import hf_hub_download
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
REPO_ID = "Bnaad/PARENT_bert"
# Load tokenizer
tokenizer = BertTokenizerFast.from_pretrained("bert-base-uncased")
# Load one TorchScript model from Hugging Face
label_name = "Information Type_Contact information"
safe_label = label_name.replace(" ", "_").replace("/", "_")
filename = f"torchscript_{safe_label}.pt"
model_path = hf_hub_download(repo_id=REPO_ID, filename=filename)
model = torch.jit.load(model_path, map_location=device)
model.to(device)
model.eval()
# Example inference
sample_text = """For any questions about your account or our services, please contact our customer support team by emailing support@example.com, calling +1-800-555-1234, or visiting our office at 123 Main Street, Springfield, IL, 62701 during business hours"""
inputs = tokenizer(
sample_text,
return_tensors="pt",
truncation=True,
padding="max_length",
max_length=512
).to(device)
with torch.no_grad():
outputs = model(inputs["input_ids"], inputs["attention_mask"])
print("Logits:", outputs)
prob = torch.sigmoid(outputs.squeeze())
print(prob)