Update README.md
Browse files
README.md
CHANGED
|
@@ -25,6 +25,8 @@ This model is capable of recognizing various types of personally identifiable in
|
|
| 25 |
## Usage
|
| 26 |
|
| 27 |
```python
|
|
|
|
|
|
|
| 28 |
text = """
|
| 29 |
Harilala Rasoanaivo, un homme d'affaires local d'Antananarivo, a enregistré une nouvelle société nommée "Rasoanaivo Enterprises" au Lot II M 92 Antohomadinika. Son numéro est le +261 32 22 345 67, et son adresse électronique est harilala.rasoanaivo@telma.mg. Il a fourni son numéro de sécu 501-02-1234 pour l'enregistrement.
|
| 30 |
"""
|
|
@@ -45,7 +47,7 @@ labels = [
|
|
| 45 |
"SSN",
|
| 46 |
"phone number",
|
| 47 |
]
|
| 48 |
-
entities =
|
| 49 |
|
| 50 |
for entity in entities:
|
| 51 |
print(entity["text"], "=>", entity["label"])
|
|
|
|
| 25 |
## Usage
|
| 26 |
|
| 27 |
```python
|
| 28 |
+
model = GLiNER.from_pretrained("vicgalle/gliner-small-pii", load_tokenizer=True)
|
| 29 |
+
|
| 30 |
text = """
|
| 31 |
Harilala Rasoanaivo, un homme d'affaires local d'Antananarivo, a enregistré une nouvelle société nommée "Rasoanaivo Enterprises" au Lot II M 92 Antohomadinika. Son numéro est le +261 32 22 345 67, et son adresse électronique est harilala.rasoanaivo@telma.mg. Il a fourni son numéro de sécu 501-02-1234 pour l'enregistrement.
|
| 32 |
"""
|
|
|
|
| 47 |
"SSN",
|
| 48 |
"phone number",
|
| 49 |
]
|
| 50 |
+
entities = model.predict_entities(text, labels, threshold=0.1)
|
| 51 |
|
| 52 |
for entity in entities:
|
| 53 |
print(entity["text"], "=>", entity["label"])
|