MCPcopy Create free account
hub / github.com/SpecterOps/DeepPass2 / get_secrets_BERT

Function get_secrets_BERT

deeppass2.py:170–181  ·  view source on GitHub ↗

Scan for secrets using finetuned xlm-RoBERTa-base model

(chunks, model=model, tokenizer=tokenizer)

Source from the content-addressed store, hash-verified

168
169
170def get_secrets_BERT(chunks, model=model, tokenizer=tokenizer):
171 """Scan for secrets using finetuned xlm-RoBERTa-base model"""
172 bert_secret = []
173
174
175 for chunk in chunks:
176 temp_secrets = classify_tokens(chunk, model, tokenizer, device=device)
177 if temp_secrets != [] and temp_secrets:
178 bert_secret.append({"secret":temp_secrets, 'chunk':chunk})
179
180
181 return bert_secret
182
183async def scan_secret(doc):
184 """Main function to scan the document for secrets"""

Callers 1

scan_secretFunction · 0.85

Calls 1

classify_tokensFunction · 0.90

Tested by

no test coverage detected