Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(De-) Serialization is not properly working for NamedEntityExtractor #7666

Closed
julian-risch opened this issue May 8, 2024 · 0 comments · Fixed by #7684
Closed

(De-) Serialization is not properly working for NamedEntityExtractor #7666

julian-risch opened this issue May 8, 2024 · 0 comments · Fixed by #7684
Assignees
Labels
P1 High priority, add to the next sprint type:bug Something isn't working
Milestone

Comments

@julian-risch
Copy link
Member

Describe the bug
Similar to #7660

When a pipeline containing a NamedEntityExtractor is deserialized, the deserialization fails with:

ConstructorError(None, None,
yaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/object/apply:haystack.components.extractors.named_entity_extractor.NamedEntityExtractorBackend'
  in "<unicode string>", line 4, column 16:
          backend: !!python/object/apply:haystack.c ...

This is caused by the NamedEntityExtractorBackend enum.

To Reproduce

from haystack import Pipeline
from haystack.components.extractors import NamedEntityExtractor, NamedEntityExtractorBackend
extractor = NamedEntityExtractor(backend=NamedEntityExtractorBackend.HUGGING_FACE, model="dslim/bert-base-NER")

p = Pipeline()
p.add_component(instance=extractor, name="extractor")

with open("test_pipeline.yaml", "w") as f:
    p.dump(f)
with open("test_pipeline.yaml", "r") as f:
    q = Pipeline.load(f)
@julian-risch julian-risch added the type:bug Something isn't working label May 8, 2024
@julian-risch julian-risch added this to the 2.1.1 milestone May 8, 2024
@masci masci removed this from the 2.1.1 milestone May 9, 2024
@masci masci added the P1 High priority, add to the next sprint label May 10, 2024
@shadeMe shadeMe added this to the 2.1.2 milestone May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High priority, add to the next sprint type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants