Views
No views yet
Mario Rossi lives at Via Roma 1, Milano. Email: m.rossi@email.com1{
2 "anonymized_text": "[NAME_1] lives at [ADDRESS_1]. Email: [EMAIL_1]",
3 "replaced_tokens": [
4 {"replaced_value": "[NAME_1]", "original_value": "Mario Rossi"},
5 {"replaced_value": "[ADDRESS_1]", "original_value": "Via Roma 1, Milano"},
6 {"replaced_value": "[EMAIL_1]", "original_value": "m.rossi@email.com"}
7 ]
8}1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3from peft import PeftModel
4
5BASE = "TinyLlama/TinyLlama-1.1B-Chat-v1.0"
6tokenizer = AutoTokenizer.from_pretrained(BASE)
7model = AutoModelForCausalLM.from_pretrained(BASE, torch_dtype=torch.float16, device_map="auto")
8model = PeftModel.from_pretrained(model, "LorenzoMascia/tinyllama-lora-anonymizer")### Instruction:
Analyze the following text and anonymize all personally identifiable information (PII). Return a JSON object with the anonymized text and all replaced tokens.
### Input:
{your text here}
### Response:q_proj, v_proj