Skip to main content

No project description provided

Project description

Overview

The cas_visualizerlibrary can be used to transform a Common Analysis System (CAS) data structure into an annotated HTML string.

The library visualizes annotations with an underlined (default) or highlighted style.

Quick start

(see self-contained example)

We require a CAS file or cassis.Cas object that contains a text, e.g.

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]

The CAS is based on a type system file or cassis.TypeSystem object and specifies annotation types, e.g.

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

To transform the text into an HTML string with underlined annotations of type NamedEntity, we run:

from cas_visualizer.visualizer import SpanVisualizer

cas = '../data/hagen.txt.xmi'
ts = '../data/TypeSystem.xml'

span_vis = SpanVisualizer(ts)

span_vis.add_type(name='NamedEntity')

html = span_vis.visualize(cas)

Finally, in a browser we can then render the HTML string:

Screenshot_1

Before visualizing the CAS, you can switch to the highlighted style by calling:

span_vis.selected_span_type = "HIGHLIGHT"

Screenshot_2


How to publish a new version:

  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.1.5.tar.gz (7.7 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.1.5-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file cas_visualizer-0.1.5.tar.gz.

File metadata

  • Download URL: cas_visualizer-0.1.5.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.9.13 Darwin/24.6.0

File hashes

Hashes for cas_visualizer-0.1.5.tar.gz
Algorithm Hash digest
SHA256 fdea1d0d092fb1a991ed5e6a603c2cb11c7f3865d05be46f8d6202b6405f786c
MD5 132c5c3c739a841e7db2d43aa532851a
BLAKE2b-256 81403c484d73da97da46c66f4ff1e39d5644124bf25b65e954bf4be984886ef5

See more details on using hashes here.

File details

Details for the file cas_visualizer-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: cas_visualizer-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.9.13 Darwin/24.6.0

File hashes

Hashes for cas_visualizer-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a099b24e0315f76f15a26947e9ef04e53718bc028322c80507b5a6f952adce63
MD5 23c8d0a0b2a66d28ed0a8a1acd1c3e6e
BLAKE2b-256 a5704cd06e08fefe74d1d5d1fc2bb0af2ec6ae1cc43ebb51b9a8bd2f9f801699

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