Skip to main content

A library for comparing and analyzing text similarity

Project description

text-Comparison

TextCompare is a Python library for comparing and analyzing text similarity. It provides various metrics and pipelines for text comparison tasks.

Detect Temporal shift

We captures the specific association between a time and an action.This captures the specific association between a time and an action. We use sets to compare these temporal-action pairs between the two texts. This allows us to identify exact matches in time-action associations. We calculate the Jaccard similarity between these sets, which gives us a measure of how similar the temporal-action structures are between the two texts.

text1 = "Yesterday, I stayed at the store. Today, I'm staying home."
text2 = "Today, I stayed at the store. Yesterday I stayed home."
Temporal actions in text 1: [('yesterday', 'stay'), ('today', 'stay')]
Temporal actions in text 2: [('today', 'stay'), ('yesterday', 'stay')]
Matching temporal-action pairs: set()
Total unique temporal-action pairs: {('yesterday', 'stay'), ('today', 'stay')}
Temporal shift similarity: 0.0
Final similarity score: 0.0
text3 = "Yesterday, I went to the store. Today, I'm staying home."
text4 = "Today, I went to the store. Yesterday I stayed home."
Temporal actions in text 3: [('yesterday', 'go'), ('today', 'stay')]
Temporal actions in text 4: [('today', 'go'), ('yesterday', 'stay')]
Matching temporal-action pairs: set()
Total unique temporal-action pairs: {('yesterday', 'go'), ('today', 'stay'), ('today', 'go'), ('yesterday', 'stay')}
Temporal shift similarity: 0.0
Final similarity score: 0.0

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

lingualens-0.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

lingualens-0.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lingualens-0.1.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for lingualens-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9f5f4cbf60d1b23f9d6822926a07f23e3acb3a2dd8b387d06dea6f9891682d0f
MD5 21a6cfc1533356f86fde35c9acb435c4
BLAKE2b-256 ecf230b47b6ea579a4761b05c79f58a983ded2f18ff4f02a0d94e5dbc4232367

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lingualens-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for lingualens-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10277a8b84abd0dc017b37ecb58ea415e09c40f1869d82a01ccfd6c0b7964c4b
MD5 19e6d2768987befd736b7168654daf44
BLAKE2b-256 6feaa2c56b3b96c3f0b36618fa5272d5485d297f328e0754c2ca1722071d4b99

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