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

[Bug] Correctly render relations visualisation in notebooks #35

Closed
GabrielePicco opened this issue Nov 17, 2022 · 0 comments · Fixed by #36
Closed

[Bug] Correctly render relations visualisation in notebooks #35

GabrielePicco opened this issue Nov 17, 2022 · 0 comments · Fixed by #36
Labels
bug Something isn't working

Comments

@GabrielePicco
Copy link
Contributor

Summary

Describe the bug
The relations visualisation should visualise correctly in the notebooks, but the render functions is displaying the HTML as string

To Reproduce
Steps to reproduce the behavior:

import spacy
from zshot import PipelineConfig, displacy
from zshot.linker import LinkerSMXM
from zshot.utils.data_models import Entity, Relation
from zshot.relation_extractor import RelationsExtractorZSRC

config = PipelineConfig(
 entities=[
    Entity(name="company", description="The name of a company"),
    Entity(name="location", description="A physical location"),
    Entity(name="chemical compound", description="Any of a large class of chemical compounds in which one or more \
           atoms of carbon are covalently linked to atoms of other elements, most commonly hydrogen, oxygen, or nitrogen")
 ], 
 relations=[
    Relation(name="acronym", description="Is the acronym of"),
    Relation(name="parent", description="Is the parent of someone")
 ], 
 linker=LinkerSMXM(),
 relations_extractor=RelationsExtractorZSRC(),
)
nlp = spacy.blank("en")
nlp.add_pipe("zshot", config=config, last=True)

text = "CH2O2 is a chemical compound similar to Acetamide used in International \
Business Machines Corporation (IBM) to create new materials that act like PAGs."
doc = nlp(text)

Expected behavior

Correctly render the HTML in the notebook

@GabrielePicco GabrielePicco added the bug Something isn't working label Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant