-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass manual=True to visualize_ner (#27)
* Add manual option to visualize_ner * Error checking Error 1: When manual=True but show_table=True Error 2: When manual=True but doc is not of type 'list'
- Loading branch information
1 parent
aa9d029
commit 6eaaf43
Showing
2 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
Example of using manual=True for visualize_ner. | ||
""" | ||
import spacy_streamlit | ||
import streamlit as st | ||
|
||
st.title("My cool app") | ||
|
||
doc = [{ | ||
"text": "But Google is starting from behind.", | ||
"ents": [{"start": 4, "end": 10, "label": "ORG"}], | ||
"title": None | ||
}] | ||
|
||
spacy_streamlit.visualize_ner( | ||
doc, | ||
labels=["ORG"], | ||
show_table=False, | ||
title="Persons, dates and locations", | ||
manual=True | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters