Views
No views yet
pip install gliner1from gliner import GLiNER
2
3model = GLiNER.from_pretrained("selfconstruct3d/AITSecNER", load_tokenizer=True)1# Example input text
2text = """
3Upon opening Emotet maldocs, victims are greeted with fake Microsoft 365 prompt that states
4“THIS DOCUMENT IS PROTECTED,” and instructs victims on how to enable macros.
5"""
6
7# Entity labels
8labels = [
9 'CLICommand/CodeSnippet', 'CON', 'DATE', 'GROUP', 'LOC',
10 'MALWARE', 'ORG', 'SECTOR', 'TACTIC', 'TECHNIQUE', 'TOOL'
11]
12
13# Predict entities
14entities = model.predict_entities(text, labels, threshold=0.5)
15
16# Display results
17for entity in entities:
18 print(f"{entity['text']} => {entity['label']}")1Emotet => MALWARE
2Microsoft => ORG