Skip to main content

The Wowool Numbers Package

Project description

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

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)

Project details


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.1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wowool_numbers-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for wowool_numbers-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ccf2827c8e08ac6b0e815c4f1c78f057b35458e15ed5f3d2ec51e7eb99d191f2
MD5 39b16ebb7a3d9e881c6c45be5bc4e4b2
BLAKE2b-256 d316faca21898e65e105ce23a36ef0e736ac8c580d7c45e69fe844d9b4e3096e

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