Skip to main content

A simple ML package to compute text similarity using TF-IDF

Project description

textsimilarity

A simple ML package to compute text similarity using TF-IDF.

Installation

pip install textsimilarity

Usage

from textsimilarity import compute_similarity, rank_by_similarity

# Compare two texts
score = compute_similarity("Machine learning is great", "I love AI and machine learning")
print(score)

# Rank documents by similarity to a query
docs = [
    "Python is great for data science",
    "I play football",
    "Machine learning is amazing"
]
print(rank_by_similarity("I love Python and machine learning", docs))

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

textsimilarityplus-0.1.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

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

textsimilarityplus-0.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for textsimilarityplus-0.1.0.tar.gz
Algorithm Hash digest
SHA256 113bbe4b3cf3ef1b6f7a7780b84c0baf61657d4632ebc485942d3f7a5aad276b
MD5 e1d61e39c96706a961af7dc5768c9368
BLAKE2b-256 878653ee175571835140a13a3b625954f0d9235defc34abe2277caefc011d4bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for textsimilarityplus-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 745441b195e58c36bad74601c114d8ff5cc4e57aac230686a21be2e6f9ced26f
MD5 25f2bb01f8fc26355635b961d62f6cd9
BLAKE2b-256 90acae24c102442a01f1cd2924475713e077c2ad1cc80e1d88f0d2ddb05b54ba

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