Spaces:
Sleeping
Sleeping
Commit ·
4841a8a
0
Parent(s):
Duplicate from spacy/pipeline-visualizer
Browse filesCo-authored-by: Mamta Narang <mamta@users.noreply.huggingface.co>
- .gitattributes +16 -0
- LICENSE +21 -0
- README.md +35 -0
- app.py +37 -0
- models.json +24 -0
- requirements.txt +93 -0
.gitattributes
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2020 ExplosionAI GmbH
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Pipeline Visualizer
|
| 3 |
+
emoji: 👀
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: red
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: 0.84.2
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
duplicated_from: spacy/pipeline-visualizer
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# Configuration
|
| 14 |
+
|
| 15 |
+
`title`: _string_
|
| 16 |
+
Display title for the Space
|
| 17 |
+
|
| 18 |
+
`emoji`: _string_
|
| 19 |
+
Space emoji (emoji-only character allowed)
|
| 20 |
+
|
| 21 |
+
`colorFrom`: _string_
|
| 22 |
+
Color for Thumbnail gradient (red, yellow, green, blue, indigo, purple, pink, gray)
|
| 23 |
+
|
| 24 |
+
`colorTo`: _string_
|
| 25 |
+
Color for Thumbnail gradient (red, yellow, green, blue, indigo, purple, pink, gray)
|
| 26 |
+
|
| 27 |
+
`sdk`: _string_
|
| 28 |
+
Can be either `gradio` or `streamlit`
|
| 29 |
+
|
| 30 |
+
`app_file`: _string_
|
| 31 |
+
Path to your main application file (which contains either `gradio` or `streamlit` Python code).
|
| 32 |
+
Path is relative to the root of the repository.
|
| 33 |
+
|
| 34 |
+
`pinned`: _boolean_
|
| 35 |
+
Whether the Space stays on top of your list.
|
app.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import spacy_streamlit
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
import srsly
|
| 4 |
+
import importlib
|
| 5 |
+
import random
|
| 6 |
+
|
| 7 |
+
DEFAULT_MODEL = "en_core_web_sm"
|
| 8 |
+
DEFAULT_TEXT = "David Bowie moved to the US in 1974, initially staying in New York City before settling in Los Angeles."
|
| 9 |
+
DESCRIPTION = """**Explore trained [spaCy](https://spacy.io) pipelines**"""
|
| 10 |
+
|
| 11 |
+
def get_all_models():
|
| 12 |
+
with open("requirements.txt") as f:
|
| 13 |
+
content = f.readlines()
|
| 14 |
+
models = []
|
| 15 |
+
for line in content:
|
| 16 |
+
if "huggingface.co" in line:
|
| 17 |
+
models.append(line.split("/")[4])
|
| 18 |
+
return models
|
| 19 |
+
|
| 20 |
+
MODELS = get_all_models()
|
| 21 |
+
|
| 22 |
+
def get_default_text(nlp):
|
| 23 |
+
# Check if spaCy has built-in example texts for the language
|
| 24 |
+
try:
|
| 25 |
+
examples = importlib.import_module(f".lang.{nlp.lang}.examples", "spacy")
|
| 26 |
+
return examples.sentences[0]
|
| 27 |
+
except (ModuleNotFoundError, ImportError):
|
| 28 |
+
return ""
|
| 29 |
+
|
| 30 |
+
spacy_streamlit.visualize(
|
| 31 |
+
MODELS,
|
| 32 |
+
default_model=DEFAULT_MODEL,
|
| 33 |
+
visualizers=["parser", "ner", "similarity", "tokens"],
|
| 34 |
+
show_visualizer_select=True,
|
| 35 |
+
sidebar_description=DESCRIPTION,
|
| 36 |
+
get_default_text=get_default_text
|
| 37 |
+
)
|
models.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Unused
|
| 2 |
+
{
|
| 3 |
+
"zh_core_web_sm":"Chinese (zh_core_web_sm)",
|
| 4 |
+
"zh_core_web_trf":"Chinese (zh_core_web_trf)",
|
| 5 |
+
"da_core_news_sm":"Danish (da_core_news_sm)",
|
| 6 |
+
"nl_core_news_sm":"Dutch (nl_core_news_sm)",
|
| 7 |
+
"en_core_web_sm":"English (en_core_web_sm)",
|
| 8 |
+
"en_core_web_trf":"English (en_core_web_trf)",
|
| 9 |
+
"fr_core_news_sm":"French (fr_core_news_sm)",
|
| 10 |
+
"de_core_news_sm":"German (de_core_news_sm)",
|
| 11 |
+
"el_core_news_sm":"Greek (el_core_news_sm)",
|
| 12 |
+
"it_core_news_sm":"Italian (it_core_news_sm)",
|
| 13 |
+
"ja_core_news_sm":"Japanese (ja_core_news_sm)",
|
| 14 |
+
"lt_core_news_sm":"Lithuanian (lt_core_news_sm)",
|
| 15 |
+
"mk_core_news_sm":"Macedonian (mk_core_news_sm)",
|
| 16 |
+
"nb_core_news_sm":"Norwegian (nb_core_news_sm)",
|
| 17 |
+
"pl_core_news_sm":"Polish (pl_core_news_sm)",
|
| 18 |
+
"pl_core_news_md":"Polish (pl_core_news_md)",
|
| 19 |
+
"pt_core_news_sm":"Portuguese (pt_core_news_sm)",
|
| 20 |
+
"pt_core_news_md":"Portuguese (pt_core_news_md)",
|
| 21 |
+
"ro_core_news_sm":"Romanian (ro_core_news_sm)",
|
| 22 |
+
"ru_core_news_sm":"Russian (ru_core_news_sm)",
|
| 23 |
+
"es_core_news_sm":"Spanish (es_core_news_sm)"
|
| 24 |
+
}
|
requirements.txt
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
spacy-streamlit==1.0.1
|
| 2 |
+
datasets==1.11.0
|
| 3 |
+
|
| 4 |
+
https://huggingface.co/spacy/ca_core_news_lg/resolve/main/ca_core_news_lg-any-py3-none-any.whl
|
| 5 |
+
https://huggingface.co/spacy/ca_core_news_md/resolve/main/ca_core_news_md-any-py3-none-any.whl
|
| 6 |
+
https://huggingface.co/spacy/ca_core_news_sm/resolve/main/ca_core_news_sm-any-py3-none-any.whl
|
| 7 |
+
https://huggingface.co/spacy/ca_core_news_trf/resolve/main/ca_core_news_trf-any-py3-none-any.whl
|
| 8 |
+
|
| 9 |
+
https://huggingface.co/spacy/da_core_news_lg/resolve/main/da_core_news_lg-any-py3-none-any.whl
|
| 10 |
+
https://huggingface.co/spacy/da_core_news_md/resolve/main/da_core_news_md-any-py3-none-any.whl
|
| 11 |
+
https://huggingface.co/spacy/da_core_news_sm/resolve/main/da_core_news_sm-any-py3-none-any.whl
|
| 12 |
+
https://huggingface.co/spacy/da_core_news_trf/resolve/main/da_core_news_trf-any-py3-none-any.whl
|
| 13 |
+
|
| 14 |
+
https://huggingface.co/spacy/de_core_news_lg/resolve/main/de_core_news_lg-any-py3-none-any.whl
|
| 15 |
+
https://huggingface.co/spacy/de_core_news_md/resolve/main/de_core_news_md-any-py3-none-any.whl
|
| 16 |
+
https://huggingface.co/spacy/de_core_news_sm/resolve/main/de_core_news_sm-any-py3-none-any.whl
|
| 17 |
+
https://huggingface.co/spacy/de_dep_news_trf/resolve/main/de_dep_news_trf-any-py3-none-any.whl
|
| 18 |
+
|
| 19 |
+
https://huggingface.co/spacy/el_core_news_lg/resolve/main/el_core_news_lg-any-py3-none-any.whl
|
| 20 |
+
https://huggingface.co/spacy/el_core_news_md/resolve/main/el_core_news_md-any-py3-none-any.whl
|
| 21 |
+
https://huggingface.co/spacy/el_core_news_sm/resolve/main/el_core_news_sm-any-py3-none-any.whl
|
| 22 |
+
|
| 23 |
+
https://huggingface.co/spacy/en_core_web_lg/resolve/main/en_core_web_lg-any-py3-none-any.whl
|
| 24 |
+
https://huggingface.co/spacy/en_core_web_md/resolve/main/en_core_web_md-any-py3-none-any.whl
|
| 25 |
+
https://huggingface.co/spacy/en_core_web_sm/resolve/main/en_core_web_sm-any-py3-none-any.whl
|
| 26 |
+
https://huggingface.co/spacy/en_core_web_trf/resolve/main/en_core_web_trf-any-py3-none-any.whl
|
| 27 |
+
|
| 28 |
+
https://huggingface.co/spacy/es_core_news_lg/resolve/main/es_core_news_lg-any-py3-none-any.whl
|
| 29 |
+
https://huggingface.co/spacy/es_core_news_md/resolve/main/es_core_news_md-any-py3-none-any.whl
|
| 30 |
+
https://huggingface.co/spacy/es_core_news_sm/resolve/main/es_core_news_sm-any-py3-none-any.whl
|
| 31 |
+
https://huggingface.co/spacy/es_dep_news_trf/resolve/main/es_dep_news_trf-any-py3-none-any.whl
|
| 32 |
+
|
| 33 |
+
https://huggingface.co/spacy/fi_core_news_lg/resolve/main/fi_core_news_lg-any-py3-none-any.whl
|
| 34 |
+
https://huggingface.co/spacy/fi_core_news_md/resolve/main/fi_core_news_md-any-py3-none-any.whl
|
| 35 |
+
https://huggingface.co/spacy/fi_core_news_sm/resolve/main/fi_core_news_sm-any-py3-none-any.whl
|
| 36 |
+
|
| 37 |
+
https://huggingface.co/spacy/fr_core_news_lg/resolve/main/fr_core_news_lg-any-py3-none-any.whl
|
| 38 |
+
https://huggingface.co/spacy/fr_core_news_md/resolve/main/fr_core_news_md-any-py3-none-any.whl
|
| 39 |
+
https://huggingface.co/spacy/fr_core_news_sm/resolve/main/fr_core_news_sm-any-py3-none-any.whl
|
| 40 |
+
https://huggingface.co/spacy/fr_dep_news_trf/resolve/main/fr_dep_news_trf-any-py3-none-any.whl
|
| 41 |
+
|
| 42 |
+
https://huggingface.co/spacy/it_core_news_lg/resolve/main/it_core_news_lg-any-py3-none-any.whl
|
| 43 |
+
https://huggingface.co/spacy/it_core_news_md/resolve/main/it_core_news_md-any-py3-none-any.whl
|
| 44 |
+
https://huggingface.co/spacy/it_core_news_sm/resolve/main/it_core_news_sm-any-py3-none-any.whl
|
| 45 |
+
|
| 46 |
+
https://huggingface.co/spacy/ja_core_news_lg/resolve/main/ja_core_news_lg-any-py3-none-any.whl
|
| 47 |
+
https://huggingface.co/spacy/ja_core_news_md/resolve/main/ja_core_news_md-any-py3-none-any.whl
|
| 48 |
+
https://huggingface.co/spacy/ja_core_news_sm/resolve/main/ja_core_news_sm-any-py3-none-any.whl
|
| 49 |
+
|
| 50 |
+
https://huggingface.co/spacy/ko_core_news_lg/resolve/main/ko_core_news_lg-any-py3-none-any.whl
|
| 51 |
+
https://huggingface.co/spacy/ko_core_news_md/resolve/main/ko_core_news_md-any-py3-none-any.whl
|
| 52 |
+
https://huggingface.co/spacy/ko_core_news_sm/resolve/main/ko_core_news_sm-any-py3-none-any.whl
|
| 53 |
+
|
| 54 |
+
https://huggingface.co/spacy/lt_core_news_lg/resolve/main/lt_core_news_lg-any-py3-none-any.whl
|
| 55 |
+
https://huggingface.co/spacy/lt_core_news_md/resolve/main/lt_core_news_md-any-py3-none-any.whl
|
| 56 |
+
https://huggingface.co/spacy/lt_core_news_sm/resolve/main/lt_core_news_sm-any-py3-none-any.whl
|
| 57 |
+
|
| 58 |
+
https://huggingface.co/spacy/mk_core_news_lg/resolve/main/mk_core_news_lg-any-py3-none-any.whl
|
| 59 |
+
https://huggingface.co/spacy/mk_core_news_md/resolve/main/mk_core_news_md-any-py3-none-any.whl
|
| 60 |
+
https://huggingface.co/spacy/mk_core_news_sm/resolve/main/mk_core_news_sm-any-py3-none-any.whl
|
| 61 |
+
|
| 62 |
+
https://huggingface.co/spacy/nb_core_news_lg/resolve/main/nb_core_news_lg-any-py3-none-any.whl
|
| 63 |
+
https://huggingface.co/spacy/nb_core_news_md/resolve/main/nb_core_news_md-any-py3-none-any.whl
|
| 64 |
+
https://huggingface.co/spacy/nb_core_news_sm/resolve/main/nb_core_news_sm-any-py3-none-any.whl
|
| 65 |
+
|
| 66 |
+
https://huggingface.co/spacy/nl_core_news_lg/resolve/main/nl_core_news_lg-any-py3-none-any.whl
|
| 67 |
+
https://huggingface.co/spacy/nl_core_news_md/resolve/main/nl_core_news_md-any-py3-none-any.whl
|
| 68 |
+
https://huggingface.co/spacy/nl_core_news_sm/resolve/main/nl_core_news_sm-any-py3-none-any.whl
|
| 69 |
+
|
| 70 |
+
https://huggingface.co/spacy/pl_core_news_lg/resolve/main/pl_core_news_lg-any-py3-none-any.whl
|
| 71 |
+
https://huggingface.co/spacy/pl_core_news_md/resolve/main/pl_core_news_md-any-py3-none-any.whl
|
| 72 |
+
https://huggingface.co/spacy/pl_core_news_sm/resolve/main/pl_core_news_sm-any-py3-none-any.whl
|
| 73 |
+
|
| 74 |
+
https://huggingface.co/spacy/pt_core_news_lg/resolve/main/pt_core_news_lg-any-py3-none-any.whl
|
| 75 |
+
https://huggingface.co/spacy/pt_core_news_md/resolve/main/pt_core_news_md-any-py3-none-any.whl
|
| 76 |
+
https://huggingface.co/spacy/pt_core_news_sm/resolve/main/pt_core_news_sm-any-py3-none-any.whl
|
| 77 |
+
|
| 78 |
+
https://huggingface.co/spacy/ro_core_news_lg/resolve/main/ro_core_news_lg-any-py3-none-any.whl
|
| 79 |
+
https://huggingface.co/spacy/ro_core_news_md/resolve/main/ro_core_news_md-any-py3-none-any.whl
|
| 80 |
+
https://huggingface.co/spacy/ro_core_news_sm/resolve/main/ro_core_news_sm-any-py3-none-any.whl
|
| 81 |
+
|
| 82 |
+
https://huggingface.co/spacy/ru_core_news_lg/resolve/main/ru_core_news_lg-any-py3-none-any.whl
|
| 83 |
+
https://huggingface.co/spacy/ru_core_news_md/resolve/main/ru_core_news_md-any-py3-none-any.whl
|
| 84 |
+
https://huggingface.co/spacy/ru_core_news_sm/resolve/main/ru_core_news_sm-any-py3-none-any.whl
|
| 85 |
+
|
| 86 |
+
https://huggingface.co/spacy/sv_core_news_lg/resolve/main/sv_core_news_lg-any-py3-none-any.whl
|
| 87 |
+
https://huggingface.co/spacy/sv_core_news_md/resolve/main/sv_core_news_md-any-py3-none-any.whl
|
| 88 |
+
https://huggingface.co/spacy/sv_core_news_sm/resolve/main/sv_core_news_sm-any-py3-none-any.whl
|
| 89 |
+
|
| 90 |
+
https://huggingface.co/spacy/zh_core_web_lg/resolve/main/zh_core_web_lg-any-py3-none-any.whl
|
| 91 |
+
https://huggingface.co/spacy/zh_core_web_md/resolve/main/zh_core_web_md-any-py3-none-any.whl
|
| 92 |
+
https://huggingface.co/spacy/zh_core_web_sm/resolve/main/zh_core_web_sm-any-py3-none-any.whl
|
| 93 |
+
https://huggingface.co/spacy/zh_core_web_trf/resolve/main/zh_core_web_trf-any-py3-none-any.whl
|