Update README.md
Browse files
README.md
CHANGED
|
@@ -16,12 +16,12 @@ tags:
|
|
| 16 |
|
| 17 |
## Installation
|
| 18 |
Install dependencies (now via our fork, wi'll update installation part after PR to GLiNER2 repo)
|
| 19 |
-
```
|
| 20 |
pip install "gliner2 @ git+https://github.com/bogdanminko/GLiNER2.git@feature/bi-encoder" torch transformers
|
| 21 |
```
|
| 22 |
## Usage
|
| 23 |
Classify Harmful messages and Detect PII via single forward pass
|
| 24 |
-
```
|
| 25 |
from gliner2 import GLiNER2
|
| 26 |
|
| 27 |
model = GLiNER2.from_pretrained("raft-security-lab/gliner-guard-biencoder")
|
|
@@ -39,4 +39,12 @@ result = model.extract(
|
|
| 39 |
"Send $500 to John Smith at john.smith@gmail.com or I'll leak your photos",
|
| 40 |
schema=schema
|
| 41 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
```
|
|
|
|
| 16 |
|
| 17 |
## Installation
|
| 18 |
Install dependencies (now via our fork, wi'll update installation part after PR to GLiNER2 repo)
|
| 19 |
+
```bash
|
| 20 |
pip install "gliner2 @ git+https://github.com/bogdanminko/GLiNER2.git@feature/bi-encoder" torch transformers
|
| 21 |
```
|
| 22 |
## Usage
|
| 23 |
Classify Harmful messages and Detect PII via single forward pass
|
| 24 |
+
```python
|
| 25 |
from gliner2 import GLiNER2
|
| 26 |
|
| 27 |
model = GLiNER2.from_pretrained("raft-security-lab/gliner-guard-biencoder")
|
|
|
|
| 39 |
"Send $500 to John Smith at john.smith@gmail.com or I'll leak your photos",
|
| 40 |
schema=schema
|
| 41 |
)
|
| 42 |
+
```
|
| 43 |
+
output:
|
| 44 |
+
```
|
| 45 |
+
{'entities': {'person': ['John Smith'],
|
| 46 |
+
'location': [],
|
| 47 |
+
'email': ['john.smith@gmail.com'],
|
| 48 |
+
'phone': []},
|
| 49 |
+
'safety': 'unsafe'}
|
| 50 |
```
|