Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
!pip install gliner
|
2 |
+
|
3 |
+
# Load model directly from Hugging Face
|
4 |
+
model = GLiNER.from_pretrained("selfconstruct3d/AITSecNER", load_tokenizer=True)
|
5 |
+
|
6 |
+
text = """
|
7 |
+
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 .
|
8 |
+
"""
|
9 |
+
|
10 |
+
# Labels for entity prediction
|
11 |
+
#labels = ['CLICommand/CodeSnippet','CON','DATE','GROUP','LOC','MALWARE','ORG','SECTOR','TACTIC','TECHNIQUE','TOOL']
|
12 |
+
|
13 |
+
# Perform entity prediction
|
14 |
+
entities = model.predict_entities(text, labels, threshold=0.5)
|
15 |
+
|
16 |
+
# Display predicted entities and their labels
|
17 |
+
for entity in entities:
|
18 |
+
print(entity["text"], "=>", entity["label"])
|