Skip to main content

No project description provided

Project description

Overview

The cas_visualizerlibrary can be used to transform a cassis.Cas object into an annotated html string.

Quick start

We start out with a cassis.Cas object that contains the following text:

Die Fernuniversität in Hagen (Eigenschreibweise: FernUniversität) ist die erste und einzige staatliche Fernuniversität in Deutschland. Ihr Sitz befindet sich in Hagen in Nordrhein-Westfalen. Nach Angaben des Statistischen Bundesamtes war sie, ohne Berücksichtigung von Akademie- und Weiterbildungsstudierenden, mit über 76.000 Studierenden im Wintersemester 2016/2017[3] die größte deutsche Universität.[4]

and is annotated with a cassis.TypeSystem annotation:

de.tudarmstadt.ukp.dkpro.core.api.ner.type.NamedEntity

Let's transform this annotation into a spacy-styled highlighted html string:

from visualizer import SpacySpanVisualiser

spacy_span_vis = SpacySpanVisualiser(cas, [])
annotation = 'de.tudarmstadt.ukp.dkpro.core.api.ner.type.NamedEntity'

spacy_span_vis.set_selected_annotations_to_types({'NAMED_ENTITY': annotation)
spacy_span_vis.set_annotations_to_colors({'NAMED_ENTITY': 'lightgreen'})
spacy_span_vis.set_span_type(SpacySpanVisualiser.SPAN_STYLE_HIGHLIGHTING)

html = spacy_span_vis.visualise()

Using streamlit we can then render it.

E.g. st.write(html, unsafe_allow_html=True):

Screenshot_1

How to publish

  1. Increase the version number in pyproject.toml
  2. Run poetry build
  3. [Optional] If no token is configured:
  4. Run poetry publish

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cas_visualizer-0.0.4rc0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cas_visualizer-0.0.4rc0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file cas_visualizer-0.0.4rc0.tar.gz.

File metadata

  • Download URL: cas_visualizer-0.0.4rc0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.9.13 Darwin/23.6.0

File hashes

Hashes for cas_visualizer-0.0.4rc0.tar.gz
Algorithm Hash digest
SHA256 78289eb33350a42f2623aceaf5d760160c1af399b96d7b27a4fb3f1f64870e34
MD5 f2c11a3bced69dbd36b25d2bf8fe1c15
BLAKE2b-256 0fc692528045ba8dd05e7ee9973713a9e0db476e3c0278020c5483a06038ae98

See more details on using hashes here.

File details

Details for the file cas_visualizer-0.0.4rc0-py3-none-any.whl.

File metadata

  • Download URL: cas_visualizer-0.0.4rc0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.9.13 Darwin/23.6.0

File hashes

Hashes for cas_visualizer-0.0.4rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 42ab4770f8b97070b5e2b4e5f90c7c7a6607960bb96b3e32b85c696742e75859
MD5 03ceefb4ceda94069fe6e8e8dea75ca3
BLAKE2b-256 1ca1f1f3043e40d73417d587b55463ed67aea23ebfb045abb2638a7cd87a4026

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page