Token Classification
Transformers
PyTorch
Safetensors
English
French
German
stacked_bert
v1.0.0
custom_code
Instructions to use impresso-project/ner-stacked-bert-multilingual-v1.1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use impresso-project/ner-stacked-bert-multilingual-v1.1.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="impresso-project/ner-stacked-bert-multilingual-v1.1.0", trust_remote_code=True)# Load model directly from transformers import AutoModelForTokenClassification model = AutoModelForTokenClassification.from_pretrained("impresso-project/ner-stacked-bert-multilingual-v1.1.0", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
a76ce02
1
Parent(s): eb6e4b3
3 filters
Browse files- generic_ner.py +6 -3
generic_ner.py
CHANGED
|
@@ -462,11 +462,14 @@ def postprocess_entities(entities):
|
|
| 462 |
|
| 463 |
# Step 2: Attach "comp.function" entities to the closest other entities
|
| 464 |
from pprint import pprint
|
| 465 |
-
|
|
|
|
| 466 |
filtered_entities = attach_comp_to_closest(filtered_entities)
|
| 467 |
-
|
|
|
|
| 468 |
filtered_entities = repair_names_in_entities(filtered_entities)
|
| 469 |
-
|
|
|
|
| 470 |
|
| 471 |
# Step 3: Remove entities that are not useful for NEL
|
| 472 |
# filtered_entities = clean_coarse_entities(filtered_entities)
|
|
|
|
| 462 |
|
| 463 |
# Step 2: Attach "comp.function" entities to the closest other entities
|
| 464 |
from pprint import pprint
|
| 465 |
+
print("Before attach_comp_to_closest:")
|
| 466 |
+
pprint(filtered_entities)
|
| 467 |
filtered_entities = attach_comp_to_closest(filtered_entities)
|
| 468 |
+
print("After attach_comp_to_closest:")
|
| 469 |
+
pprint(filtered_entities)
|
| 470 |
filtered_entities = repair_names_in_entities(filtered_entities)
|
| 471 |
+
print("After repair_names_in_entities:")
|
| 472 |
+
pprint(filtered_entities)
|
| 473 |
|
| 474 |
# Step 3: Remove entities that are not useful for NEL
|
| 475 |
# filtered_entities = clean_coarse_entities(filtered_entities)
|