Update README.md
Browse files
README.md
CHANGED
@@ -19,7 +19,7 @@ Load the pretrained AITSecNER model directly from Hugging Face:
|
|
19 |
```python
|
20 |
from gliner import GLiNER
|
21 |
|
22 |
-
model = GLiNER.from_pretrained(
|
23 |
```
|
24 |
|
25 |
### Predict Entities
|
@@ -28,10 +28,10 @@ Define the input text and entity labels you wish to extract:
|
|
28 |
|
29 |
```python
|
30 |
# Example input text
|
31 |
-
text =
|
32 |
Upon opening Emotet maldocs, victims are greeted with fake Microsoft 365 prompt that states
|
33 |
“THIS DOCUMENT IS PROTECTED,” and instructs victims on how to enable macros.
|
34 |
-
|
35 |
|
36 |
# Entity labels
|
37 |
labels = [
|
@@ -44,7 +44,7 @@ entities = model.predict_entities(text, labels, threshold=0.5)
|
|
44 |
|
45 |
# Display results
|
46 |
for entity in entities:
|
47 |
-
print(f
|
48 |
```
|
49 |
|
50 |
### Sample Output
|
|
|
19 |
```python
|
20 |
from gliner import GLiNER
|
21 |
|
22 |
+
model = GLiNER.from_pretrained("selfconstruct3d/AITSecNER", load_tokenizer=True)
|
23 |
```
|
24 |
|
25 |
### Predict Entities
|
|
|
28 |
|
29 |
```python
|
30 |
# Example input text
|
31 |
+
text = """
|
32 |
Upon opening Emotet maldocs, victims are greeted with fake Microsoft 365 prompt that states
|
33 |
“THIS DOCUMENT IS PROTECTED,” and instructs victims on how to enable macros.
|
34 |
+
"""
|
35 |
|
36 |
# Entity labels
|
37 |
labels = [
|
|
|
44 |
|
45 |
# Display results
|
46 |
for entity in entities:
|
47 |
+
print(f"{entity['text']} => {entity['label']}")
|
48 |
```
|
49 |
|
50 |
### Sample Output
|