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
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)
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 from the wowool.sdk package to detect the language of a text 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()
# Process the data
doc = lid(document)
print(doc.language)
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file wowool_sdk-3.2.2.dev2.tar.gz.
File metadata
- Download URL: wowool_sdk-3.2.2.dev2.tar.gz
- Upload date:
- Size: 73.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0ac628808bcaaf1e3a1aab9ef934d5674025bd8e2199b4f0b4a22c6dcfb5df7
|
|
| MD5 |
7604e0faa262ebaa92d9059d5d17e8fc
|
|
| BLAKE2b-256 |
4291046a9076139efc06e6c38c2c293c93a505b0a7ef24fad04e21672bd53961
|