Skip to main content

Extract from a given long text input, eCommerce products and price budget.

Project description

ECTOR

Extract from a given long text input, eCommerce products and price budget.

DISCLAIMER

This is not an "OpenAI wrapper", it use NLP(Natural Language Processing) and tokens manipulations to 'understand the given input' then extract product key name + budget.

Therefore, this is not 100% optimized at all and was not tested on extreme edge-cases. However it's quite fast and does the job for my use case at the moment.

REQUIREMENTS

HOW TO INSTALL

pip install ector

HOW TO USE

$ python
Python 3.12.9 (main, Feb  5 2025, 08:49:01) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> import asyncio
>>> from ector import extract
>>>
>>> text = "Hello, do you have some apple juice at 9 eur ? i also want bananas, but i only have 15 eur"
>>> print(json.dumps(asyncio.run(extract(text)), indent=2))
{
  "products": [
    {
      "product": "Apple juice",
      "price": 9.0,
      "currency": "eur"
    },
    {
      "product": "Bananas"
    }
  ],
  "budget": {
    "price": 15.0,
    "currency": "eur"
  }
}
>>>

AUTHOR

  • Sanix-Darker

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

ector-0.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

ector-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file ector-0.1.0.tar.gz.

File metadata

  • Download URL: ector-0.1.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/6.8.0-1021-azure

File hashes

Hashes for ector-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fdbe2f41e0e4b4b6ffbb0600f9c4a00e415a099925885d169fbe9ede3164864a
MD5 25dccb318ab0a0dd9139a56b8f246f3a
BLAKE2b-256 465cf022e92b647fd1b847b87e0738eb53fa1e87346828d9499c12c845f70d50

See more details on using hashes here.

File details

Details for the file ector-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ector-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/6.8.0-1021-azure

File hashes

Hashes for ector-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7fe83e9ce00436df0f65070214dbca4ba6d1363b4b03e9203c5161530a49997
MD5 fecd01d7eb5ba37a953d163762cff930
BLAKE2b-256 309d293d77f79aebccf493f700eaee9a2a2b1a76140e5b30aab2d08043e415ad

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