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
1. Building a Pattern
2. Extraction
- Load the German Language Model from spaCy.
- Add turCy to the nlp-Pipeline.
- Pass the document to the pipeline.
- 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
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)
| File | Size | Uploaded | |
|---|---|---|---|
| turcy-0.0.42.tar.gz | 513.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|