Skip to main content

turCy

An Open Information Extraction System mainly designed for German.

Installation

pip install turcy

Can be applied to other languages as well, however some extrawork is necessary as no patterns for english are shipped. Therefore, you would have to build your own patterns first. For building patterns, a `pattern_builder module is available.

How it works

img_3.png

1. Building a Pattern

img_2.png

img_1.png

2. Extraction

  1. Load the German Language Model from spaCy.
  2. Add turCy to the nlp-Pipeline.
  3. Pass the document to the pipeline.
  4. Iterate over the sentences in the document and access the triples in each sentence.
def example():
    nlp = spacy.load("de_core_news_lg", exclude=["ner"])
    nlp.max_length = 2096700
    turcy.add_to_pipe(nlp)  # apply/use current patterns in list
    pipeline_params = {"attach_triple2sentence": {"pattern_list": "small"}}
    doc = nlp("Nürnberg ist eine Stadt in Deutschland.", component_cfg=pipeline_params)
    for sent in doc.sents:
        print(sent)
        for triple in sent._.triples:
            (subj, pred, obj) = triple["triple"]
            print(f"subject:'{subj}', predicate:'{pred}' and object: '{obj}'")

3. Results

img_5.png

img_6.png

References

Metadata

Release files for turcy 0.0.42

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for turcy 0.0.42
File Size Uploaded
turcy-0.0.42.tar.gz 513.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for turcy 0.0.42
File Interpreter ABI Platform
turcy-0.0.42-py3-none-any.whl Python 3 none any Details

Total release size: 1.8 MB

Release files / turcy-0.0.42.tar.gz

Download URL turcy-0.0.42.tar.gz
Size 513.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d37115f2b5c0f7777f8d36f92d8f98268e082690669bc268c6e6403dbda67062
BLAKE2b-256 checksum
How to use checksums
150fb9de25302b4c769d231092102a2bd8e16384564eda74f52a5a4ff0706798
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.6.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Release files / turcy-0.0.42-py3-none-any.whl

Download URL turcy-0.0.42-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9d2e07509732881b694ba972813f87ebe371b80051b7d9e52f2e1f2e371f9c19
BLAKE2b-256 checksum
How to use checksums
0d710f2412a10191908466f8a7211e21448ebac1e68b2b6a3529dec3df39d0a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.6.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.42 This release

2 release files

0.0.35

2 release files

0.0.34

2 release files

0.0.33

2 release files

0.0.32

2 release files

0.0.31

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page