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.2.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.2.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lingualens-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 c00afa9208077d41f7d9cf9859cbd5032a034ff57655267fb75615e5982f2ace
MD5 34f2545bf48c81fdf08db66a93fdd0bb
BLAKE2b-256 84c339136e6faa8f64977b97230ac8858a6072ea7c648bbd70308dec94c34691

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lingualens-0.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f0435c6bf73ea328f5d37f0f263c972966723b4c9da6a9b0a221869d25f734a
MD5 52464f6b010d8b4acb2de7e09d81bea3
BLAKE2b-256 0f2c78fd1eaa5f16de80edd676550b3a138ccf5af0bcbeeb3522b29a1103f9dd

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