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.4.tar.gz (73.0 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.4-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.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (42.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

wowool_sdk-3.5.4-cp313-cp313-macosx_11_0_arm64.whl (69.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

wowool_sdk-3.5.4-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.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (41.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

wowool_sdk-3.5.4-cp312-cp312-macosx_11_0_arm64.whl (69.4 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

wowool_sdk-3.5.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (42.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for wowool_sdk-3.5.4.tar.gz
Algorithm Hash digest
SHA256 de8212c482eb39184b1eb70bbf00f003a528a24b9f5b1d179b0e181535a7e125
MD5 7db2ab52ec66d7680fa9fdf8ae63ad0a
BLAKE2b-256 992d0ca8aaf37209134a5e904c0efd2b0ca8a5367bb04dc3df17d81decb6dd9b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wowool_sdk-3.5.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7db0fd5592dc2b24236323f4af389e1a0c5975d625dff5d79e211c9feee04e08
MD5 f8162f9f6e031ce9e21634640a6bec7b
BLAKE2b-256 d19cc78b134547f38865dacd93bad4977418ba9a71fb193d246f00010cb171b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wowool_sdk-3.5.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 5502950f8e5c743cafd86a3312bbef26e447d425381bf77278884c02fa50c140
MD5 1e0a579a4f44eebb6f66660651c0f30a
BLAKE2b-256 2c8adfb4cb6abeb5c4f37882e2edb82f9e5f824a9a27e52d35f9f48721f99639

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wowool_sdk-3.5.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 40ac7685667f8d6c4b332a1b83b1c1313f0874657de2267a2e5aebc7608f5bf9
MD5 d627962d4f38f1058645d958d904153c
BLAKE2b-256 b6f34e1484be3e96106e8d9e63b2a94efa335b7daa5cbaf154e844d095d5511d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wowool_sdk-3.5.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cedd02b6dfc300616f4c821a80653a4a6f0d0944960a3d880eabb43cbaae092d
MD5 44b23f5b0a47578e6cded496e8735a83
BLAKE2b-256 acc4add9242fc25438526aa6aa4b314e53c67c07739ab35aa56720a372cdefe8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wowool_sdk-3.5.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 8ba1c7fe94d3c79ebffa66d98b3344b5ea66ebdb0c8ab00db0e2d15d4c4c9efc
MD5 dd75ba18b0dbb7ff9307a481cda6d85d
BLAKE2b-256 4282dc5a6e28c46e984dfcfb9ece12bc073fd3eeeed6cfcfb69d8c53b2a7c32b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wowool_sdk-3.5.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 16d07acd0d066189f2c5fbf185dc90c1bb95434e3916840405e12a82aab273ec
MD5 d93e8fa576c9a92faec8b52047bc7d7e
BLAKE2b-256 23e4e42c4e7247c9331b10bd67a372542060096d0e8a4f0fee1e75b5f2b64f3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wowool_sdk-3.5.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e8989aac344749a545e12c8e6e7739dee247a7f632f0ecd95043dc2084879b11
MD5 154512a94275703cdbfdb77b0d551729
BLAKE2b-256 bd0285b1fa76d9a1abd49fdfe416247ade88ba813d2771d50c3820b3150923c5

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