Skip to main content

Estimate how time-bound text is: 0.0 (ephemeral) to 1.0 (timeless facts)

Project description

temporal-text

Estimate how time-bound text is, from ephemeral thoughts to timeless facts.

What is Temporality?

Temporality measures how "time-bound" a piece of text is:

  • Low temporality (0.0): Fleeting, immediate, ephemeral

    • "I want to go to the sauna" → ~0.15
    • "Just saw the funniest thing" → ~0.10
    • "brb getting snacks" → ~0.05
  • High temporality (1.0): Timeless facts, universal truths

    • "Earth has one moon" → ~0.85
    • "A triangle has three sides" → ~0.85
    • "Water boils at 100 degrees Celsius" → ~0.85

Installation

pip install temporal-text

Usage

from temporal_text import temporality_score

# Low temporality - fleeting desire
score = temporality_score("I want to go to the sauna")
print(score)  # ~0.15

# High temporality - scientific fact
score = temporality_score("Earth has one moon")
print(score)  # ~0.85

# Medium temporality - current situation
score = temporality_score("I'm currently learning Spanish")
print(score)  # ~0.35

How It Works

The library uses a lightweight TF-IDF + Ridge Regression model trained on ~1700 labeled examples. The model learns patterns like:

High temporality indicators: "is a", "always", "contains", "equals", "measures"

Low temporality indicators: "I", "my", "feel", "just", "tomorrow", "now"

The pre-trained model (~110KB) is bundled with the package - no downloads or API calls required.

License

MIT

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

temporal_text-0.1.0.tar.gz (51.2 kB view details)

Uploaded Source

Built Distribution

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

temporal_text-0.1.0-py3-none-any.whl (51.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: temporal_text-0.1.0.tar.gz
  • Upload date:
  • Size: 51.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for temporal_text-0.1.0.tar.gz
Algorithm Hash digest
SHA256 591e7d7bb431ea0e1fde4897ef5fc91ec0b1c4fdf2707dcd4471b2a649392b7e
MD5 7a59b9b0e248f7b193dbba6ef7519d56
BLAKE2b-256 50dbf8231e02cf244c6a80cfa26a029135f367179dc9bbc34a9a290cd0289c0b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: temporal_text-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 51.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for temporal_text-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 941132824297cdb4ccfe774bee6f5624fa15e178a9f4c253047a7a3b67fe792e
MD5 fa03797bde2fa5ba64bb25e7c1be8cc9
BLAKE2b-256 f79db1f6c19540583c40cbd8ee28b40af277989515fb2adce1a1a12510b0add5

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