Skip to main content

Wowool NLP Toolkit

Project description

The Wowool NLP Toolkit

install

Install the main sdk.

pip install wowool-sdk

Installing languages.

pip install wowool-[language]

Quick Start

Just create a document and pipeline, pass your document trough the Pipeline, and your done.

from wowool.sdk import Pipeline
from wowool.document import Document

document = Document("Mark Van Den Berg works at Omega Pharma.")
# Create an analyzer for a given language and options
process = Pipeline("english,entity")
# Process the data
document = process(document)
print(document)

API

Examples

You will need to install the english language module to run the sample. pip install wowool-english

Create a pipeline.

This script demonstrates how to use the UUID component to create a pipeline.

from wowool.sdk import Pipeline
from wowool.common.pipeline import UUID

process = Pipeline(
    [
        UUID("english", options={"anaphora": False}),
        UUID("entity"),
        UUID("topics.app", {"count": 3}),
    ]
)
document = process("Mark Janssens works at Omega Pharma.")
print(document)

Custom domain

The script identifies the word "car" as a Vehicle entity in the sentence "I have a car." using custom domain rules and language processing.

For more info on how to write rules see: https://www.wowool.com/docs/nlp/matching-&-capturing

from wowool.sdk import Language, Domain
from wowool.document import Document

english = Language("english")
vehicle = Domain(source="rule:{ 'car'} = Vehicle;")
doc = vehicle(english(Document("I have a car.")))
for entity in doc.entities:
    print(entity)

Using the language identifier

This script demonstrates how to use the LanguageIdentifier to detect the language of a document.

from wowool.sdk import LanguageIdentifier

document = """
Un été de tous les records de chaleur en France.
Record de chaleur battu dans une cinquantaine de villes en France

"""
# Initialize a language identification engine
lid = LanguageIdentifier()
# Process the data
doc = lid(document)
print(doc.language)

Extract dutch entities

This script demonstrates how to perform basic entity analysis on a Dutch sentence using the Wowool SDK.

Install first the dutch language model pip install wowool-dutch

from wowool.sdk import Pipeline
from wowool.document import Document

entities = Pipeline("dutch,entity")
document = entities(Document("Mark Van Den Berg werkte als hoofdarts bij Omega Pharma."))
for sentence in document.sentences:
    for entity in sentence.entities:
        print(entity)

Using the language identifier

This script demonstrates how to use the LanguageIdentifier to detect the different language sections in a text multi-language document.

from wowool.sdk import LanguageIdentifier

document = """
La juventud no es más que un estado de ánimo.

Record de chaleur battu dans une cinquantaine de villes en France

"""
# Initialize a language identification engine
lid = LanguageIdentifier(sections=True, section_data=True)
# Process the data
doc = lid(document)
if lid_results := doc.lid:
    for section in doc.lid.sections:
        assert section.text
        print(f"({section.begin_offset},{section.end_offset}): language= {section.language} text={section.text[:20].strip('\n')}...")

License

In both cases you will need to acquirer a license file at https://www.wowool.com

Non-Commercial

This library is licensed under the GNU AGPLv3 for non-commercial use.  
For commercial use, a separate license must be purchased.  

Commercial license Terms

1. Grants the right to use this library in proprietary software.  
2. Requires a valid license key  
3. Redistribution in SaaS requires a commercial license.  

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

wowool_sdk-3.5.3.tar.gz (72.3 kB view details)

Uploaded Source

Built Distributions

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

wowool_sdk-3.5.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (42.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

wowool_sdk-3.5.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (75.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

wowool_sdk-3.5.3-cp313-cp313-macosx_11_0_arm64.whl (69.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

wowool_sdk-3.5.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (42.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

wowool_sdk-3.5.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (75.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

wowool_sdk-3.5.3-cp312-cp312-macosx_11_0_arm64.whl (69.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

wowool_sdk-3.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (42.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

File details

Details for the file wowool_sdk-3.5.3.tar.gz.

File metadata

  • Download URL: wowool_sdk-3.5.3.tar.gz
  • Upload date:
  • Size: 72.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for wowool_sdk-3.5.3.tar.gz
Algorithm Hash digest
SHA256 26fb9188d4f8d2c252229859a58751903e4aef53c1427fd8d67e2fb48aef1f4c
MD5 5cfd71dab2acdb2794412a393de75f55
BLAKE2b-256 6a2b872b890739f592cf050ca7f7cba81f9beaab16cb26b2b6fde5cbae6a4c4b

See more details on using hashes here.

File details

Details for the file wowool_sdk-3.5.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for wowool_sdk-3.5.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d37269c09cca9e9cbcd18f694752c4e92427c654156dc46387eeb94495fb37e7
MD5 1facf88268023a37d1aafc5a5a147338
BLAKE2b-256 f4efea39d3536fc32ebf89f03ec6137278894e9e99eec8915da8f6b2e709235d

See more details on using hashes here.

File details

Details for the file wowool_sdk-3.5.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for wowool_sdk-3.5.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 133ce0a9fba29e8a64dce954b86eee60a930c4c2f22e3cb64419e74e973bea94
MD5 6ea8bd938a70ca40ecac503bf649989e
BLAKE2b-256 2295333abb789c8fefde7206aa9c42883609fc00eb01a8a15f7a891a561a2335

See more details on using hashes here.

File details

Details for the file wowool_sdk-3.5.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for wowool_sdk-3.5.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0a384f0fdcb2ee04913d398263d0d0afb1a2902a12e27a0383a293040286d07a
MD5 29adace514cc5c2aebf53e509b3d24f9
BLAKE2b-256 d9957c878980431d620843f39d100f2e898101978fbbdb0b7029c8ca7aedae12

See more details on using hashes here.

File details

Details for the file wowool_sdk-3.5.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for wowool_sdk-3.5.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e8ba890a0b17e0d8c69c3813c84a86d2ffaa5ed0eb872338a647c4ac3e34dc36
MD5 7af2d0b63453b00061891f84cf3a86f2
BLAKE2b-256 6d28b9b4c192ae4c416e5cd5e196e1774b08471ed0b8f893b5c97b8a5c38a582

See more details on using hashes here.

File details

Details for the file wowool_sdk-3.5.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for wowool_sdk-3.5.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 30eb06b15ca85b61a8e3c1eb8b1942a2f80ed1874e0533f144dc6b8e4e1f8e4a
MD5 dc4df025fe2dd0097b71cc0dce87c0df
BLAKE2b-256 1961a3403ba07e5c5aaeb98d9bcc5876dd3f59381804d827d1cb4c52d383dac0

See more details on using hashes here.

File details

Details for the file wowool_sdk-3.5.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for wowool_sdk-3.5.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6c6309e418353705e57f905c54e5229b12812a7b65c00a1a70c2bef8a41cb54d
MD5 60bfbcabc035f35e36ed2bb32f5e2fa0
BLAKE2b-256 f90d4f10a0cd9616f72b44beaa75484f2e17c28ed3971d07f44f2755eb3527b4

See more details on using hashes here.

File details

Details for the file wowool_sdk-3.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for wowool_sdk-3.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a115bf635d01528f3ee75a279ac7e7f5e42fa4e1eee5c9c926b9f0daa72ad0dc
MD5 027ea7d593fa74517f21e85b695de74f
BLAKE2b-256 b6a6e36bdd8ba36354d4cc108351a58e4be48fedbf239373c6188bdbc8a6e461

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