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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
113bbe4b3cf3ef1b6f7a7780b84c0baf61657d4632ebc485942d3f7a5aad276b
|
|
| MD5 |
e1d61e39c96706a961af7dc5768c9368
|
|
| BLAKE2b-256 |
878653ee175571835140a13a3b625954f0d9235defc34abe2277caefc011d4bd
|
File details
Details for the file textsimilarityplus-0.1.0-py3-none-any.whl.
File metadata
- Download URL: textsimilarityplus-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
745441b195e58c36bad74601c114d8ff5cc4e57aac230686a21be2e6f9ced26f
|
|
| MD5 |
25f2bb01f8fc26355635b961d62f6cd9
|
|
| BLAKE2b-256 |
90acae24c102442a01f1cd2924475713e077c2ad1cc80e1d88f0d2ddb05b54ba
|