Downloads · 30 days
11
3% of all-time downloads
hyacinthum/Piidgeon-ai4privacy
Piidgeon-ai4privacy is a machine learning model from hyacinthum. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as cc-by-nc-4.0.
This model serves to enhance the precision and accuracy of personal information detection by utilizing a reduced label set compared to its base model. Through this refinement, it aims to provide superior labeling prec…
Downloads · 30 days
11
3% of all-time downloads
All-time downloads
404
Public
Parameters
278M
10.9 GB on disk
Likes
1
Public
Click a slice to open those files.
.ckpt6.7 GB · 77%
From the Hugging Face model README
This model serves to enhance the precision and accuracy of personal information detection by utilizing a reduced label set compared to its base model. Through this refinement, it aims to provide superior labeling precision for identifying personal information across multiple languages.
Improved Precision: By reducing the label set size from the base model, the model enhances the precision of the labeling procedure, ensuring more reliable identification of sensitive information.
Model Versions:
Maximum Accuracy Focus: This version aims to achieve the highest possible accuracy in the detection process, making it suitable for applications where minimizing errors is crucial.
Maximum Precision Focus: This variant is designed to maximize the precision of the detection, ideal for scenarios where false positives are particularly undesirable.
To run this model, you will need to install the dependencies:
pip install torch transformers safetensors
Load and run the model using PyTorch and transformers:
from transformers import AutoModelForTokenClassification, AutoConfig, BertTokenizerFast
from safetensors.torch import load_file
# Load the config
config = AutoConfig.from_pretrained("folder_to_model")
# Initialize the model with the config
model = AutoModelForTokenClassification.from_config(config)
# Load the safetensors weights
state_dict = load_file("folder_to_tensors")
# Load the state dict into the model
model.load_state_dict(state_dict)
# Load the tokenizer
tokenizer = BertTokenizerFast.from_pretrained("google-bert/bert-base-multilingual-cased")
# Load the label mapper if needed
with open("pii_model/label_mapper.json", 'r') as f:
label_mapper_data = json.load(f)
label_mapper = LabelMapper()
label_mapper.label_to_id = label_mapper_data['label_to_id']
label_mapper.id_to_label = {int(k): v for k, v in label_mapper_data['id_to_label'].items()}
label_mapper.num_labels = label_mapper_data['num_labels']
# Process outputs for analysis...
The publisher of this repository is not affiliated with Ai4Privacy and Ai Suisse SA
This repo created during the Hackaton organized by NeuralWave