👑 spaCy building blocks and visualizers for Streamlit apps

Overview

spacy-streamlit: spaCy building blocks for Streamlit apps

This package contains utilities for visualizing spaCy models and building interactive spaCy-powered apps with Streamlit. It includes various building blocks you can use in your own Streamlit app, like visualizers for syntactic dependencies, named entities, text classification, semantic similarity via word vectors, token attributes, and more.

Current Release Version pypi Version

🚀 Quickstart

You can install spacy-streamlit from pip:

pip install spacy-streamlit

The package includes building blocks that call into Streamlit and set up all the required elements for you. You can either use the individual components directly and combine them with other elements in your app, or call the visualize function to embed the whole visualizer.

Download the English model from spaCy to get started.

python -m spacy download en_core_web_sm

Then put the following example code in a file.

# streamlit_app.py
import spacy_streamlit

models = ["en_core_web_sm", "en_core_web_md"]
default_text = "Sundar Pichai is the CEO of Google."
spacy_streamlit.visualize(models, default_text)

You can then run your app with streamlit run streamlit_app.py. The app should pop up in your web browser. 😀

📦 Example: 01_out-of-the-box.py

Use the embedded visualizer with custom settings out-of-the-box.

streamlit run https://raw.githubusercontent.com/explosion/spacy-streamlit/master/examples/01_out-of-the-box.py

👑 Example: 02_custom.py

Use individual components in your existing app.

streamlit run https://raw.githubusercontent.com/explosion/spacy-streamlit/master/examples/02_custom.py

🎛 API

Visualizer components

These functions can be used in your Streamlit app. They call into streamlit under the hood and set up the required elements.

function visualize

Embed the full visualizer with selected components.

import spacy_streamlit

models = ["en_core_web_sm", "/path/to/model"]
default_text = "Sundar Pichai is the CEO of Google."
visualizers = ["ner", "textcat"]
spacy_streamlit.visualize(models, default_text, visualizers)
Argument Type Description
models List[str] / Dict[str, str] Names of loadable spaCy models (paths or package names). The models become selectable via a dropdown. Can either be a list of names or the names mapped to descriptions to display in the dropdown.
default_text str Default text to analyze on load. Defaults to "".
default_model Optional[str] Optional name of default model. If not set, the first model in the list of models is used.
visualizers List[str] Names of visualizers to show. Defaults to ["parser", "ner", "textcat", "similarity", "tokens"].
ner_labels Optional[List[str]] NER labels to include. If not set, all labels present in the "ner" pipeline component will be used.
ner_attrs List[str] Span attributes shown in table of named entities. See visualizer.py for defaults.
token_attrs List[str] Token attributes to show in token visualizer. See visualizer.py for defaults.
similarity_texts Tuple[str, str] The default texts to compare in the similarity visualizer. Defaults to ("apple", "orange").
show_json_doc bool Show button to toggle JSON representation of the Doc. Defaults to True.
show_meta bool Show button to toggle meta.json of the current pipeline. Defaults to True.
show_config bool Show button to toggle config.cfg of the current pipeline. Defaults to True.
show_visualizer_select bool Show sidebar dropdown to select visualizers to display (based on enabled visualizers). Defaults to False.
sidebar_title Optional[str] Title shown in the sidebar. Defaults to None.
sidebar_description Optional[str] Description shown in the sidebar. Accepts Markdown-formatted text.
show_logo bool Show the spaCy logo in the sidebar. Defaults to True.
color Optional[str] Experimental: Primary color to use for some of the main UI elements (None to disable hack). Defaults to "#09A3D5".
get_default_text Callable[[Language], str] Optional callable that takes the currently loaded nlp object and returns the default text. Can be used to provide language-specific default texts. If the function returns None, the value of default_text is used, if available. Defaults to None.

function visualize_parser

Visualize the dependency parse and part-of-speech tags using spaCy's displacy visualizer.

import spacy
from spacy_streamlit import visualize_parser

nlp = spacy.load("en_core_web_sm")
doc = nlp("This is a text")
visualize_parser(doc)
Argument Type Description
doc Doc The spaCy Doc object to visualize.
keyword-only
title Optional[str] Title of the visualizer block.
sidebar_title Optional[str] Title of the config settings in the sidebar.

function visualize_ner

Visualize the named entities in a Doc using spaCy's displacy visualizer.

import spacy
from spacy_streamlit import visualize_ner

nlp = spacy.load("en_core_web_sm")
doc = nlp("Sundar Pichai is the CEO of Google.")
visualize_ner(doc, labels=nlp.get_pipe("ner").labels)
Argument Type Description
doc Doc The spaCy Doc object to visualize.
keyword-only
labels Sequence[str] The labels to show in the labels dropdown.
attrs List[str] The span attributes to show in entity table.
show_table bool Whether to show a table of entities and their attributes. Defaults to True.
title Optional[str] Title of the visualizer block.
sidebar_title Optional[str] Title of the config settings in the sidebar.
colors Dict[str,str] A dictionary mapping labels to display colors ({"LABEL": "COLOR"})

function visualize_textcat

Visualize text categories predicted by a trained text classifier.

import spacy
from spacy_streamlit import visualize_textcat

nlp = spacy.load("./my_textcat_model")
doc = nlp("This is a text about a topic")
visualize_textcat(doc)
Argument Type Description
doc Doc The spaCy Doc object to visualize.
keyword-only
title Optional[str] Title of the visualizer block.

visualize_similarity

Visualize semantic similarity using the model's word vectors. Will show a warning if no vectors are present in the model.

import spacy
from spacy_streamlit import visualize_similarity

nlp = spacy.load("en_core_web_lg")
visualize_similarity(nlp, ("pizza", "fries"))
Argument Type Description
nlp Language The loaded nlp object with vectors.
default_texts Tuple[str, str] The default texts to compare on load. Defaults to ("apple", "orange").
keyword-only
threshold float Threshold for what's considered "similar". If the similarity score is greater than the threshold, the result is shown as similar. Defaults to 0.5.
title Optional[str] Title of the visualizer block.

function visualize_tokens

Visualize the tokens in a Doc and their attributes.

import spacy
from spacy_streamlit import visualize_tokens

nlp = spacy.load("en_core_web_sm")
doc = nlp("This is a text")
visualize_tokens(doc, attrs=["text", "pos_", "dep_", "ent_type_"])
Argument Type Description
doc Doc The spaCy Doc object to visualize.
keyword-only
attrs List[str] The names of token attributes to use. See visualizer.py for defaults.
title Optional[str] Title of the visualizer block.

Cached helpers

These helpers attempt to cache loaded models and created Doc objects.

function process_text

Process a text with a model of a given name and create a Doc object. Calls into the load_model helper to load the model.

import streamlit as st
from spacy_streamlit import process_text

spacy_model = st.sidebar.selectbox("Model name", ["en_core_web_sm", "en_core_web_md"])
text = st.text_area("Text to analyze", "This is a text")
doc = process_text(spacy_model, text)
Argument Type Description
model_name str Loadable spaCy model name. Can be path or package name.
text str The text to process.
RETURNS Doc The processed document.

function load_model

Load a spaCy model from a path or installed package and return a loaded nlp object.

import streamlit as st
from spacy_streamlit import load_model

spacy_model = st.sidebar.selectbox("Model name", ["en_core_web_sm", "en_core_web_md"])
nlp = load_model(spacy_model)
Argument Type Description
name str Loadable spaCy model name. Can be path or package name.
RETURNS Language The loaded nlp object.
Comments
  • Support for span categorizer?

    Support for span categorizer?

    Is it possible to visualize spancat predictions via spacy-streamlit yet? Either directly or by customizing one of the existing visualizers? I haven't been able to find any examples of this.

    enhancement 
    opened by jonmcalder 5
  • Pass manual=True to visualize_ner

    Pass manual=True to visualize_ner

    Adjusted visualize_ner to include manual as an argument that is passed into displacy_render, and added a new file 03_visualize-ner-manual.py to show how it works.

    Let me know if this PR can be improved, as this is one of my first open-source contributions, and I am still learning :)

    Closes #14

    opened by callistachang 4
  • Be able to specify port & host

    Be able to specify port & host

    I'm currently running the spacy-streamlit app on a server. I prefer to have this on my server on my local network because otherwise my laptop gets very hot during training. In order to properly host it though I need to be able to customise the port-number as well as the host. It seems like these settings are currently missing. Would @ines you be open to these commands? I wouldn't mind picking this up.

    enhancement 
    opened by koaning 4
  • 'NoneType' object has no attribute 'replace'

    'NoneType' object has no attribute 'replace'

    When I ran the example:

    import spacy_streamlit models = ["en_core_web_sm", "en_core_web_md"] default_text = "Sundar Pichai is the CEO of Google." spacy_streamlit.visualize(models, default_text)

    Have this problem

    AttributeError Traceback (most recent call last) in 3 models = ["en_core_web_sm", "en_core_web_md"] 4 default_text = "Sundar Pichai is the CEO of Google." ----> 5 spacy_streamlit.visualize(models, default_text)

    ~/anaconda3/lib/python3.7/site-packages/spacy_streamlit/visualizer.py in visualize(models, default_text, visualizers, ner_labels, ner_attrs, similarity_texts, token_attrs, show_json_doc, show_model_meta, sidebar_title, sidebar_description, show_logo, color) 51 52 if "parser" in visualizers: ---> 53 visualize_parser(doc) 54 if "ner" in visualizers: 55 ner_labels = ner_labels or nlp.get_pipe("ner").labels

    ~/anaconda3/lib/python3.7/site-packages/spacy_streamlit/visualizer.py in visualize_parser(doc, title, sidebar_title) 98 html = displacy.render(sent, options=options, style="dep") 99 # Double newlines seem to mess with the rendering --> 100 html = html.replace("\n\n", "\n") 101 if split_sents and len(docs) > 1: 102 st.markdown(f"> {sent.text}")

    AttributeError: 'NoneType' object has no attribute 'replace'

    opened by PilarHidalgo 4
  • `visualize_spans` function + `manual` argument + docstrings

    `visualize_spans` function + `manual` argument + docstrings

    Adds a visualize_spans function for using the span visualization in displaCy.

    I made a few choices that may need justification:

    • Even though spans_key is part of the options passed to displaCy, it feels critical enough to pass as an argument to visualize_spans rather than as a key/value in a dict to displacy_options - but we can obviously undo this.
    • I didn't include the span viz in the "display everything" visualize function because none of the base models will have labeled spans in them, so it wouldn't display anything useful.
    • Compared to visualize_ner:
      • I removed the manual argument because there's no such option for that with displaCy for spans
      • There's no label filtering/selection with spans, so all labels will be displayed for spans within a span_key. This removes the keys and labels args.

    Extra:

    • Also added a missing docstring for the show_table argument on visualize_ner (as well as visualize_spans)

    Open questions:

    • Is there a script to generate the nice readme.md documentation so we can include the new function?
    • I'm not totally sure what needs to happen for a release, but I'm happy to help do whatever needs to be done!
    opened by pmbaumgartner 2
  • NotImplementedError: [E894] The 'noun_chunks' syntax iterator is not implemented for language 'it'.

    NotImplementedError: [E894] The 'noun_chunks' syntax iterator is not implemented for language 'it'.

    I'm trying to use the italian model and getting this error why usine visualize_parser.

    File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/streamlit/scriptrunner/script_runner.py", line 443, in _run_script
        exec(code, module.__dict__)
      File "/home/irfan/PycharmProjects/TES-Clone/main.py", line 385, in <module>
        visualize_parser(doc)
      File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/spacy_streamlit/visualizer.py", line 156, in visualize_parser
        html = displacy.render(sent, options=options, style="dep")
      File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/spacy/displacy/__init__.py", line 57, in render
        parsed = [converter(doc, options) for doc in docs] if not manual else docs  # type: ignore
      File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/spacy/displacy/__init__.py", line 57, in <listcomp>
        parsed = [converter(doc, options) for doc in docs] if not manual else docs  # type: ignore
      File "/home/irfan/environments/The-Entities-Swissknife/lib/python3.7/site-packages/spacy/displacy/__init__.py", line 131, in parse_deps
        for np in list(doc.noun_chunks):
      File "spacy/tokens/doc.pyx", line 852, in noun_chunks
    NotImplementedError: [E894] The 'noun_chunks' syntax iterator is not implemented for language 'it'.
    

    Here are the models and library info

    en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.2.0/en_core_web_sm-3.2.0-py3-none-any.whl
    it-core-news-sm @ https://github.com/explosion/spacy-models/releases/download/it_core_news_sm-3.2.0/it_core_news_sm-3.2.0-py3-none-any.whl
    spacy==3.2.4
    spacy-legacy==3.0.9
    spacy-loggers==1.0.2
    spacy-streamlit==1.0.3
    
    
    opened by mirfan899 2
  • OSError: [E050] Can't find model 'en_core_web_sm'. It doesn't seem to be a Python package or a valid path to a data directory.

    OSError: [E050] Can't find model 'en_core_web_sm'. It doesn't seem to be a Python package or a valid path to a data directory.

    Hi. 👋 This is my first time ever submitting an issue on Github. I resolved the issue somehow myself but I thought it's important to report and share the possible bug anyway. I'll try my best to follow the github issue submit best practices, I hope I'm doing it correctly.

    My code

    import spacy nlp = spacy.load('en')

    Errors I ran into

    Error 1

    OSError: [E050] Can't find model 'en_core_web_sm'. It doesn't seem to be a Python package or a valid path to a data directory.
    

    Error 2

    [E053] Could not read config.cfg from c:\users\Pycharmprojects\my_project_foler\venv\lib\site-packages\en_core_web_sm\en_core_web_sm-2.2.0\config.cfg
    

    After Error 1, I tried the following link. https://github.com/explosion/spaCy/issues/4577

    Then the first error resolved and pycharm threw the error 2 right after. I tried all the pip install github_links but didn't work. https://github.com/explosion/spaCy/issues/7453

    Unsuccessful attempts in order

    1. download python3 -m spacy download en_core_web_sm

    2. Upgrade pip3 install -U spacy

    3. Github link 1 pip3 install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.0/en_core_web_sm-2.2.0.tar.gz

    4. Github link 2 pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0.tar.gz Failed to build spacy

    5. validate python -m spacy validate

    6. install pip install --no-cache-dir spacy

    What worked

    python -m spacy download en

    As of spaCy v3.0, shortcuts like 'en' are deprecated. Please use the full
    pipeline package name 'en_core_web_sm' instead.
    Collecting en-core-web-sm==3.2.0
    

    The terminal automatically downloaded en_core_web_sm and it worked. But this was the first thing I had tried. Is it because I used python3 instead of python in the command...?

    Thank you!

    opened by deep-woods 2
  • Text from a scanned document.

    Text from a scanned document.

    Many research institutes in humanities scan documents and books and get text via OCR. We can analyze the text, but is there a standard way to connect the scan and the text when you know the coefficient of where the word or phrase is on the image.

    opened by ericvanderlinden 2
  • Getting text or disabling text box from .visualizer

    Getting text or disabling text box from .visualizer

    When you use:

    spacy_streamlit.visualize()
    

    How do you get the textual data input into the text box? Can we disable that text box and feed directly into visualize instead?

    question 
    opened by ritchieng 2
  • 'labels' parameter of visualize_ner()

    'labels' parameter of visualize_ner()

    Hi! The default labels parameter of visualize_ner() is an empty tuple and I think we can make it more explicit because today I was debugging to figure out why my custom entities were not being displayed :P. Maybe I'm missing something, what does keyword-only mean? (docs table)

    Back to the labels parameter, I'm not sure if it's best to:

    • modify the method to check if the tuple is empty and if so get all labels from the doc
    • simply add a required label in the docs

    I modified the docs because it's more straightforward, let me know if you think it's not a good path. Thanks!

    opened by dmesquita 2
  • AttributeError: module 'spacy_streamlit' has no attribute 'visualizer'

    AttributeError: module 'spacy_streamlit' has no attribute 'visualizer'

    import spacy_streamlit
    
    models = ["en_core_web_sm", "en_core_web_md"]
    default_text = "Sundar Pichai is the CEO of Google."
    spacy_streamlit.visualize(models, default_text)
    

    gives the error:

    AttributeError: module 'spacy_streamlit' has no attribute 'visualizer'
    Traceback:
    
    File "e:\wpy-3710\python-3.7.1.amd64\lib\site-packages\streamlit\ScriptRunner.py", line 322, in _run_script
        exec(code, module.__dict__)
    File "e:\work\Python\spacy_streamlit.py", line 1, in <module>
        import spacy_streamlit
    File "e:\work\Python\spacy_streamlit.py", line 5, in <module>
        spacy_streamlit.visualizer(models, default_text)
    

    I am using Windows 10 WinPython 3.7.1

    Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32

    opened by Code4SAFrankie 2
  • ModuleNotFoundError in demo

    ModuleNotFoundError in demo

    when opening https://ines-spacy-streamlit-demo-app-a6h19v.streamlit.app/ I encounter a ModuleNotFoundError

    Traceback: File "/home/appuser/venv/lib/python3.7/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script exec(code, module.dict) File "/app/spacy-streamlit-demo/app.py", line 1, in import spacy_streamlit File "/home/appuser/venv/lib/python3.7/site-packages/spacy_streamlit/init.py", line 1, in from .visualizer import visualize, visualize_parser, visualize_ner, visualize_spans File "/home/appuser/venv/lib/python3.7/site-packages/spacy_streamlit/visualizer.py", line 3, in import spacy File "/home/appuser/venv/lib/python3.7/site-packages/spacy/init.py", line 14, in from .cli.info import info # noqa: F401 File "/home/appuser/venv/lib/python3.7/site-packages/spacy/cli/init.py", line 3, in from ._util import app, setup_cli # noqa: F401 File "/home/appuser/venv/lib/python3.7/site-packages/spacy/cli/_util.py", line 8, in import typer File "/home/appuser/venv/lib/python3.7/site-packages/typer/init.py", line 29, in from .main import Typer as Typer File "/home/appuser/venv/lib/python3.7/site-packages/typer/main.py", line 11, in from .completion import get_completion_inspect_parameters File "/home/appuser/venv/lib/python3.7/site-packages/typer/completion.py", line 10, in import click._bashcomplete

    opened by bsenst 1
  • Visualization of nested spans

    Visualization of nested spans

    Dear all,

    I'm trying to use the new span visualizer to display some custom, nested spans predicted by spancat. This is my code:

    MODEL_PATH = # ...
    DEFAULT_TEXT = """Cetuximab ist ein monoklonaler Antikörper, der gegen den epidermalen Wachstumsfaktorrezeptor (EGFR) gerichtet ist und \
        dient zur Therapie des fortgeschrittenen kolorektalen Karzinoms zusammen mit Irinotecan oder in Kombination mit FOLFOX bzw. \
        allein nach Versagen einer Behandlung mit Oxaliplatin und Irinotecan."""
    
    st.set_page_config(layout="wide")
    
    text = st.text_area("Text to analyze", DEFAULT_TEXT)
    doc = process_text(MODEL_PATH, text)
    
    visualize_spans(doc, spans_key="snomed", displacy_options=
        {"colors": {
            "Clinical_Drug": "#99FF99", "External_Substance" : "#CCFFCC", "Nutrient_or_Body_Substance" : "#E5FFCC", 
            "Therapeutic" : "#66B2FF", "Diagnostic" : "#CCE5FF",
            "Other_Finding" : "#FFE5CC", "Diagnosis_or_Pathology" : "#FFCCCC"}} )
    

    myapp

    The nested spans are all shown on the same line, which makes it very hard to read. I learned from the feature on LinkedIn, where a video was shown with nested spans nicely displayed.

    demo

    How can I achieve this behavior? Do I need to pass some other options?

    opened by phlobo 0
  • visualize_spans

    visualize_spans

    I have been trying to use this but keep on getting this error ImportError: cannot import name 'visualize_spans' from partially initialized module 'spacy_streamlit' (most likely due to a circular import)

    spacy 3.3.1 spacy_streamlit 1.0.4

    opened by monWork 2
  • Unexpected keyword errors

    Unexpected keyword errors

    Hello,

    I aa looking to use spacy-streamlit to visualise custom sentences and entities output from my own model.

    When running some of your example .py files, I have found errors https://github.com/explosion/spacy-streamlit/tree/master/examples

    03_visualize-ner-manual.py The error says: TypeError: visualize_ner() got an unexpected keyword argument 'manual'

    04_visualize-ner-extra-options.pyThe error says: TypeError: visualize_ner() got an unexpected keyword argument 'displacy_options'

    I think this may be a big. Is there a way around this?

    opened by rory-hurley-gds 1
Releases(v1.0.4)
  • v1.0.4(Jun 14, 2022)

    ✨ New features and improvements

    • NEW visualize_spans for span support in displaCy.:

      • PR https://github.com/explosion/spacy-streamlit/pull/37
    • visualize_{parser,ner,spans} functions now take a manual argument for rendering data manually

    • Updated docstrings with correct arguments & types

    • visualize_parser now takes displacy_options for providing options for that visualizer.

    • New examples scripts:

    👥 Contributors

    @pmbaumgartner, @svlandeg, @rmitsch

    What's Changed

    • Fix title in example 03 by @svlandeg in https://github.com/explosion/spacy-streamlit/pull/35
    • visualize_spans function + manual argument + docstrings by @pmbaumgartner in https://github.com/explosion/spacy-streamlit/pull/37

    Full Changelog: https://github.com/explosion/spacy-streamlit/compare/v1.0.3...v1.0.4

    Source code(tar.gz)
    Source code(zip)
  • v1.0.3(Mar 31, 2022)

    ✨ New features and improvements

    • Improvements to visualize_ner:

      • PR https://github.com/explosion/spacy-streamlit/pull/26: UX and layout improvements
      • PR https://github.com/explosion/spacy-streamlit/pull/27: Allow manual option in visualize_ner
      • PR https://github.com/explosion/spacy-streamlit/pull/31: Allow extra displacy_options to be passed to visualize_ner
    • PR https://github.com/explosion/spacy-streamlit/pull/25: Use the streamlit theming options directly in visualizer.py

    • PR https://github.com/explosion/spacy-streamlit/pull/29: Ensure the correct texts are passed onwards in visualize_similarity

    • New examples scripts:

    👥 Contributors

    @callistachang, @honnibal, @ines, @Jette16, @narayanacharya6, @svlandeg

    Source code(tar.gz)
    Source code(zip)
  • v1.0.2(Aug 25, 2021)

  • v1.0.0(Mar 12, 2021)

  • v1.0.0rc1(Jan 27, 2021)

    🌙 This release is a pre-release and requires spaCy v3 (nightly).

    • Upgrade to latest Streamlit and use columns and expander widgets for controls.
    • Move visualizer-specific settings into main content instead of sidebar.
    • Add show_config setting to show config.cfg of currently loaded model.
    • Add default_model setting to specify option to auto-select in dropdown.
    • Add show_pipeline_info setting to toggle pipeline description in sidebar.
    • Update default token attributes to include Token.morph and Token.is_sent_start.
    • Add get_default_text callback to generate default text based on nlp object (e.g. language).
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0rc0(Oct 15, 2020)

    🌙 This release is a pre-release and requires spaCy v3 (nightly).

    • Upgrade to latest Streamlit and use columns and expander widgets for controls.
    • Move visualizer-specific settings into main content instead of sidebar.
    • Add show_config setting to show config.cfg of currently loaded model.
    • Add default_model setting to specify option to auto-select in dropdown.
    • Add show_pipeline_info setting to toggle pipeline description in sidebar.
    • Update default token attributes to include Token.morph and Token.is_sent_start.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Sep 19, 2020)

    • Clean up custom CSS for color theme.
    • Support both lists of model names as well as a dict mapping models to descriptions to display in the dropdown.
    • Add show_visualizer_select option to allow user to toggle displayed visualizers (based on the specified options).
    • Use checkboxes instead of buttons for JSON Doc and model meta.
    Source code(tar.gz)
    Source code(zip)
  • v0.0.3(Sep 2, 2020)

    • Add key argument to widgets to prevent problem with duplicate widgets.
    • Add colors parameter to ner_visualizer.

    Thanks to @Jcharis, @yagays, @pmbaumgartner, @andfanilo and @discdiver for the pull requests!

    Source code(tar.gz)
    Source code(zip)
Owner
Explosion
A software company specializing in developer tools for Artificial Intelligence and Natural Language Processing
Explosion
Unlimited Call - Text Bombing Tool

FastBomber Unlimited Call - Text Bombing Tool Installation On Termux

Aryan 6 Nov 10, 2022
中文問句產生器;使用台達電閱讀理解資料集(DRCD)

Transformer QG on DRCD The inputs of the model refers to we integrate C and A into a new C' in the following form. C' = [c1, c2, ..., [HL], a1, ..., a

Philip 1 Oct 22, 2021
本项目是作者们根据个人面试和经验总结出的自然语言处理(NLP)面试准备的学习笔记与资料,该资料目前包含 自然语言处理各领域的 面试题积累。

【关于 NLP】那些你不知道的事 作者:杨夕、芙蕖、李玲、陈海顺、twilight、LeoLRH、JimmyDU、艾春辉、张永泰、金金金 介绍 本项目是作者们根据个人面试和经验总结出的自然语言处理(NLP)面试准备的学习笔记与资料,该资料目前包含 自然语言处理各领域的 面试题积累。 目录架构 一、【

1.4k Dec 30, 2022
Multilingual Emotion classification using BERT (fine-tuning). Published at the WASSA workshop (ACL2022).

XLM-EMO: Multilingual Emotion Prediction in Social Media Text Abstract Detecting emotion in text allows social and computational scientists to study h

MilaNLP 35 Sep 17, 2022
The NewSHead dataset is a multi-doc headline dataset used in NHNet for training a headline summarization model.

This repository contains the raw dataset used in NHNet [1] for the task of News Story Headline Generation. The code of data processing and training is available under Tensorflow Models - NHNet.

Google Research Datasets 31 Jul 15, 2022
Nystromformer: A Nystrom-based Algorithm for Approximating Self-Attention

Nystromformer: A Nystrom-based Algorithm for Approximating Self-Attention April 6, 2021 We extended segment-means to compute landmarks without requiri

Zhanpeng Zeng 322 Jan 01, 2023
Source code and dataset for ACL 2019 paper "ERNIE: Enhanced Language Representation with Informative Entities"

ERNIE Source code and dataset for "ERNIE: Enhanced Language Representation with Informative Entities" Reqirements: Pytorch=0.4.1 Python3 tqdm boto3 r

THUNLP 1.3k Dec 30, 2022
🤕 spelling exceptions builder for lazy people

🤕 spelling exceptions builder for lazy people

Vlad Bokov 3 May 12, 2022
TextFlint is a multilingual robustness evaluation platform for natural language processing tasks,

TextFlint is a multilingual robustness evaluation platform for natural language processing tasks, which unifies general text transformation, task-specific transformation, adversarial attack, sub-popu

TextFlint 587 Dec 20, 2022
Searching keywords in PDF file folders

keyword_searching Steps to use this Python scripts: (1)Paste this script into the file folder containing the PDF files you need to search from; (2)Thi

1 Nov 08, 2021
Protein Language Model

ProteinLM We pretrain protein language model based on Megatron-LM framework, and then evaluate the pretrained model results on TAPE (Tasks Assessing P

THUDM 77 Dec 27, 2022
Finetune gpt-2 in google colab

gpt-2-colab finetune gpt-2 in google colab sample result (117M) from retraining on A Tale of Two Cities by Charles Di

212 Jan 02, 2023
Persian-lexicon - A lexicon of 70K unique Persian (Farsi) words

Persian Lexicon This repo uses Uppsala Persian Corpus (UPC) to construct a lexic

Saman Vaisipour 7 Apr 01, 2022
sangha, pronounced "suhng-guh", is a social networking, booking platform where students and teachers can share their practice.

Flask React Project This is the backend for the Flask React project. Getting started Clone this repository (only this branch) git clone https://github

Courtney Newcomer 17 Sep 29, 2021
Source code for the paper "TearingNet: Point Cloud Autoencoder to Learn Topology-Friendly Representations"

TearingNet: Point Cloud Autoencoder to Learn Topology-Friendly Representations Created by Jiahao Pang, Duanshun Li, and Dong Tian from InterDigital In

InterDigital 21 Dec 29, 2022
原神抽卡记录数据集-Genshin Impact gacha data

提要 持续收集原神抽卡记录中 可以使用抽卡记录导出工具导出抽卡记录的json,将json文件发送至[email protected],我会在清除个人信息后

117 Dec 27, 2022
PyKaldi is a Python scripting layer for the Kaldi speech recognition toolkit.

PyKaldi is a Python scripting layer for the Kaldi speech recognition toolkit. It provides easy-to-use, low-overhead, first-class Python wrappers for t

922 Dec 31, 2022
Reproduction process of BERT on SST2 dataset

BERT-SST2-Prod Reproduction process of BERT on SST2 dataset 安装说明 下载代码库 git clone https://github.com/JunnYu/BERT-SST2-Prod 进入文件夹,安装requirements pip ins

yujun 1 Nov 18, 2021
A Domain Specific Language (DSL) for building language patterns. These can be later compiled into spaCy patterns, pure regex, or any other format

RITA DSL This is a language, loosely based on language Apache UIMA RUTA, focused on writing manual language rules, which compiles into either spaCy co

Šarūnas Navickas 60 Sep 26, 2022
PyTorch source code of NAACL 2019 paper "An Embarrassingly Simple Approach for Transfer Learning from Pretrained Language Models"

This repository contains source code for NAACL 2019 paper "An Embarrassingly Simple Approach for Transfer Learning from Pretrained Language Models" (P

Alexandra Chronopoulou 89 Aug 12, 2022