Skip to main content

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 canonical representing the normalized value

The entity MoneyAmount is extended with:

  • The attribute amount representing the normalized value
  • The attribute currency representing 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 canonical representing the normalized value

The entity MoneyAmount is extended with:

  • The attribute amount representing the normalized value
  • The attribute currency representing 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.  

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

wowool_numbers-2.1.5-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file wowool_numbers-2.1.5-py3-none-any.whl.

File metadata

  • Download URL: wowool_numbers-2.1.5-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for wowool_numbers-2.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0314ec5b4bad7e622c942170ab4811f79613c752369373f1dc55e63ccc9872a1
MD5 639b65d311d09c66f7cec2807ab00527
BLAKE2b-256 8ddf1e1197dbb00260ca4001222ab302c16ccd0362b28996c2af44b448c90822

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.1.5 This release

1 file

2.1.4

1 file

2.1.3

1 file

2.1.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page