mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-08-29 04:26:20 +00:00
Fix HuggingFace NER kwargs handling (#1188)
Co-authored-by: Shahzaib Ahmad <malikshahzaib7145@example.com> Co-authored-by: Zohaib Hassnain <109234410+ZohaibHassan16@users.noreply.github.com>
This commit is contained in:
co-authored by
Shahzaib Ahmad
Zohaib Hassnain
parent
3c99f447e6
commit
d3f37f798e
@@ -779,9 +779,11 @@ def extract_entities_huggingface(
|
||||
"""
|
||||
loader = HuggingFaceModelLoader(device=device)
|
||||
# Pass kwargs (like aggregation_strategy) to load_ner_model
|
||||
model_obj = loader.load_ner_model(model, **kwargs)
|
||||
loader_kwargs = {
|
||||
key: value for key, value in kwargs.items() if key != "huggingface_model"
|
||||
}
|
||||
model_obj = loader.load_ner_model(model, **loader_kwargs)
|
||||
results = loader.extract_entities(model_obj, text)
|
||||
|
||||
entities = []
|
||||
|
||||
# Check if manual aggregation is needed (raw IOB tags detected)
|
||||
|
||||
Reference in New Issue
Block a user