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.2.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.2-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.2-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.2-cp313-cp313-macosx_11_0_arm64.whl (69.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

wowool_sdk-3.5.2-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.2-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.2-cp312-cp312-macosx_11_0_arm64.whl (69.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

wowool_sdk-3.5.2-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.2.tar.gz.

File metadata

  • Download URL: wowool_sdk-3.5.2.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.2.tar.gz
Algorithm Hash digest
SHA256 e7a718758897f68d02cc7faf25ccafbfa3cf4c129471475d7dc4c55b6d153922
MD5 293a0c218c0b0751d0efde2dfa1b4120
BLAKE2b-256 267de9cf0545bd5dd7fc4d23f1467f6b99da88e7cdf75f602717aacfc84f4548

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wowool_sdk-3.5.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 410dce118e2e9e37a003c9a46f997ce19936bf931e68283f317fec64082ccca3
MD5 7384b0fd92345f21839a0db3ac6862ff
BLAKE2b-256 1eb2edf2eaa465b2e792a61d27da92e23bdc8659b5148bdfe5b2347e4bf06b97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wowool_sdk-3.5.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 36572f4749b88578fb76db647aede6bbc9f5d3259abf51161f64a697bcb77d65
MD5 f5b438d6c1489160776f2c8718bf0d12
BLAKE2b-256 fe482a36bbb7ef0f0bab0ccfa846951b0ebe9cdf12a13ac11e1c238af7c4fd39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wowool_sdk-3.5.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 31c943901bdba780bf6d725dfc57103abd8c0004d6b5d692b2ebbefa8960bced
MD5 46cefa124b873f3dfbf56596a1d3207a
BLAKE2b-256 f59cf54f47ae9f4845c98bc092b59cde6fe99f76ab313df5a9d6c4b33642222e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wowool_sdk-3.5.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 41983e9d38df6cd08b7958876fd9138780d30755fbd11170aabe259b1e9f5454
MD5 b415cf96a0f7526c0cc4ce16aad85455
BLAKE2b-256 e253bd051ff7b2f48a4c5cb419b2c57a1a68a72e6c54708f41c5e923fefed7f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wowool_sdk-3.5.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 66a1c300495831bb4aa9d891d7877f3d5954f9e4c8563f8736915b707819d231
MD5 26f1525c048edcaebc1993d7e1425470
BLAKE2b-256 b56d43caab3d550ee46236672b7803c5df80c6ef79272fb185e07670234c28d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wowool_sdk-3.5.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cee02e3f24e34aae6928f57bd11bf8c06ab8c380daf811e965044368f2ccd9cd
MD5 839d4059a41b8c672a05bd248dee0f61
BLAKE2b-256 230f2671545feca892a2d9e43dac3e59a237a8cea3675116a51c519adb878033

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wowool_sdk-3.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4bcd8825d7c5447cf249e51fe4ba30186fd1516d40a3dcb1730a5c07e8483baa
MD5 9ff9db5ce74e9bdb876798c9f214144e
BLAKE2b-256 b48e63459f31466b90f4a67ea71a32061e58c7e6c80a0d2cf8a6fed745bd1e5e

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