From written word to numerical value
The numbers app enriches numerical annotations for written numbers, units and money amounts by extending the annotations with attributes representing the normalized values.
Options
NumbersOptions
interface NumbersOptions {
comma_separator?: string;
language?: string;
source?: string;
}
with:
| Property | Description |
|---|---|
comma_separator |
Default character to use as a comma separator in case it cannot be determined |
language |
Language file to use |
source |
Wowool source code to annotate a Number. Optional and only used if the language has not been set and no domain has previously been run that already annotations numbers |
Results
The entity Number is extended with:
- The attribute
canonicalrepresenting the normalized value
The entity MoneyAmount is extended with:
- The attribute
amountrepresenting the normalized value - The attribute
currencyrepresenting the currency, if present
Examples of a domain that produce Number and MoneyAmount is entity.
Examples
From written word to numerical value
The numbers app enriches numerical annotations for written numbers, units and money amounts by extending the annotations with attributes representing the normalized values.
Options
NumbersOptions
interface NumbersOptions {
comma_separator?: string;
language?: string;
source?: string;
}
with:
| Property | Description |
|---|---|
comma_separator |
Default character to use as a comma separator in case it cannot be determined |
language |
Language file to use |
source |
Wowool source code to annotate a Number. Optional and only used if the language has not been set and no domain has previously been run that already annotations numbers |
Results
The entity Number is extended with:
- The attribute
canonicalrepresenting the normalized value
The entity MoneyAmount is extended with:
- The attribute
amountrepresenting the normalized value - The attribute
currencyrepresenting the currency, if present
Examples of a domain that produce Number and MoneyAmount is entity.
API
Examples
You will need to install the english language module to run the sample. pip install wowool-english
Converting written numbers into values
The file shows how to use the wowool pipeline to extract and normalize monetary amounts from English text. The pipeline processes the text and enrich the annotation with the Number and MoneyAmount annotations.
- MoneyAmount@(amount='2000000.0' code='EUR' name='Euro' )
- Number@(canonical='2000000.0' )
- MoneyAmount@(amount='1189.0' code='USD' name='United States dollar' )
- Number,@(canonical='1189.0' )
from wowool.sdk import Pipeline
text = "I have 2m euro's and ten thousand one hundred eighty-nine dollars."
pipeline = Pipeline(["english", "numbers.language", "entity", "numbers.app"])
document = pipeline(text)
print(document)
results in:
S:( 0, 66)
T:( 0, 1): I,{+1p, +init-cap, +init-token, +nom, +sg},[I:Pron-Pers]
T:( 2, 6): have,[have:V-Pres-have]
C:( 7, 14): MoneyAmount,@(amount='2000000.0' code='EUR' name='Euro' )
C:( 7, 9): Number,@(canonical='2000000.0' )
T:( 7, 8): 2,[2:Num]
T:( 8, 9): m,{+value, +wowool/english-numbers@dev},[million:Num-Std]
C:( 10, 14): CurrencyUnit
T:( 10, 14): euro,{+currency},[euro:Nn-Sg]
T:( 14, 16): 's,[be:V-Pres-Sg-be]
T:( 17, 20): and,[and:Conj-Coord]
C:( 21, 65): MoneyAmount,@(amount='10189.0' code='USD' name='United States dollar' )
C:( 21, 57): Number,@(canonical='10189.0' )
T:( 21, 24): ten,{+wowool/english-numbers@dev},[ten:Num-Std]
T:( 25, 33): thousand,{+quant, +wowool/english-numbers@dev},[thousand:Num-Std]
T:( 34, 37): one,{+wowool/english-numbers@dev},[one:Num-Std]
T:( 38, 45): hundred,{+quant, +wowool/english-numbers@dev},[hundred:Num-Std]
T:( 46, 52): eighty,{+wowool/english-numbers@dev},[eighty:Num-Std]
T:( 52, 53): -,[-:Punct]
T:( 53, 57): nine,{+wowool/english-numbers@dev},[nine:Num-Std]
C:( 58, 65): CurrencyUnit
T:( 58, 65): dollars,{+currency},[dollar:Nn-Pl]
T:( 65, 66): .,[.:Punct-Sent]
wowool_numbers, []
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.
Metadata
Release files for wowool-numbers 2.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wowool_numbers-2.1.5-py3-none-any.whl | Python 3 | none | any | Details for wowool_numbers-2.1.5-py3-none-any.whl |
Release files / wowool_numbers-2.1.5-py3-none-any.whl
| Download URL | wowool_numbers-2.1.5-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0314ec5b4bad7e622c942170ab4811f79613c752369373f1dc55e63ccc9872a1
|
|
BLAKE2b-256 checksum How to use checksums |
8ddf1e1197dbb00260ca4001222ab302c16ccd0362b28996c2af44b448c90822
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Security for wowool-numbers 2.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.