This is simply a word similarity model that matches the desired word to the most similar word in a reference list of words provided by the user.
Project description
wordsim
This is the source code of a smart model that finds the similarity between a given word and a reference list of words. Then it returns the word that has the most similarity.
Code
from wordsim import wordSim # import the model.
lst = ['Red', 'Green', 'Blue'] # declare a list of reference words.
model = wordSim() # create an instance of the class 'wordSim'.
model.train(lst) # train the model.
test_word = 'gren' # specify the required word to test.
results = model.predict(word=test_word, tunner=2) # pass the 'test word' as an argument and tune the 'tunner' for best performance.
print(results) # print the results.
print(model.get_best()) # or print the results that way.
#console:
{'word': 'gren', 'word_match': 'Green', 'status': 'successful', 'score': 0.3333333333333333}
{'word': 'gren', 'word_match': 'Green', 'status': 'successful', 'score': 0.3333333333333333}
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 wordsim-0.1.2.tar.gz.
File metadata
- Download URL: wordsim-0.1.2.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
760b3857824affba140c311ef1a89695878ad078e7648512d524678828fcb05c
|
|
| MD5 |
151a1872d40e53a9e6b74f3b6b1d6c57
|
|
| BLAKE2b-256 |
7de7984061e6824c49dac6abca6c73fd54dbe2dd69e594b49214e039963e0641
|
File details
Details for the file wordsim-0.1.2-py3-none-any.whl.
File metadata
- Download URL: wordsim-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2caea1482f95393f589577c3138898ea6082b99127ea11c80fbc74171dcdd179
|
|
| MD5 |
d80be004c4a407ccb99c1956b7e5eb7e
|
|
| BLAKE2b-256 |
5ef493cff1cbcf6481bdf93f557d2ba943afaf1aa5def662dcd429dc292a3b43
|