Closed pmbaumgartner closed 2 years ago
I've added a few more updates, so the name of this branch is a bit of misnomer now.
I've updated visualize_parser
and visualize_spans
to take an argument manual
so that they can all take data in the format described here: https://spacy.io/usage/visualizers#manual-usage
I've also updated the docstrings to include this argument, as well as added the args to the docstrings for visualize_parser
.
Some smaller updates after testing out locally a bit more:
1️⃣ Added a very simple example app.
2️⃣ Added an exception catch if they have a version of spaCy before spans were supported in displaCy.
ValueError: 'visualize_spans' requires spacy>=3.3.0
3️⃣ Updated the README with a visualize_spans example and documentation.
Adds a
visualize_spans
function for using the span visualization in displaCy.I made a few choices that may need justification:
spans_key
is part of theoptions
passed to displaCy, it feels critical enough to pass as an argument tovisualize_spans
rather than as a key/value in a dict todisplacy_options
- but we can obviously undo this.visualize
function because none of the base models will have labeled spans in them, so it wouldn't display anything useful.visualize_ner
:manual
argument because there's no such option for that with displaCy for spansspan_key
. This removes thekeys
andlabels
args.Extra:
show_table
argument onvisualize_ner
(as well asvisualize_spans
)Open questions:
readme.md
documentation so we can include the new function?