Skip to content
Discussion options

You must be logged in to vote

displaCy doesn't have a built-in mode for that, but you can just specify the arcs manually - see this section in the docs.

Here's an example from there of manually specified arcs:

{
    "words": [
        {"text": "This", "tag": "DT"},
        {"text": "is", "tag": "VBZ"},
        {"text": "a", "tag": "DT"},
        {"text": "sentence", "tag": "NN"}
    ],
    "arcs": [
        {"start": 0, "end": 1, "label": "nsubj", "dir": "left"},
        {"start": 2, "end": 3, "label": "det", "dir": "left"},
        {"start": 1, "end": 3, "label": "attr", "dir": "right"}
    ]
}

In this example the arcs are dependency relations, but you can just modify those to be your relations.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@venti07
Comment options

@polm
Comment options

Answer selected by venti07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / visualizers Feature: Built-in displaCy and other visualizers
2 participants