File size: 704 Bytes
d75c15f 0462d37 d75c15f 0462d37 d75c15f 0462d37 d75c15f 0462d37 d75c15f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | !pip install gliner
### Load model directly from Hugging Face
model = GLiNER.from_pretrained("selfconstruct3d/AITSecNER", load_tokenizer=True)
text = """
Upon opening Emotet maldocs , victims are greeted with fake Microsoft 365 prompt that states “ THIS DOCUMENT IS PROTECTED , ” and instructs victims on how to enable macros .
"""
### Labels for entity prediction
#labels = ['CLICommand/CodeSnippet','CON','DATE','GROUP','LOC','MALWARE','ORG','SECTOR','TACTIC','TECHNIQUE','TOOL']
### Perform entity prediction
entities = model.predict_entities(text, labels, threshold=0.5)
### Display predicted entities and their labels
for entity in entities:
print(entity["text"], "=>", entity["label"]) |