Skip to main content

Calculates semantic similarity between given sentences.

Project description

Sentence Similarity

sentencesimilarity is a Python library that calculates similarity between given sentences list.

Installation

Use the package manager pip to install foobar.

pip install sentencesimilarity

Usage

from sentencesimilarity import sentences_similarity

# call SentenceSimilarity class with the parameter model name
sentenceSimilarity = sentences_similarity.SentenceSimilarity("your_transformers_model")

# define your sentences as list
sentences = ['Python is the best programming language!',
             'I literally love programming Python.',
             'Fenerbahce will be the champion this season.'
            ]

# Calculates the similarity of the first sentence with other sentences 
print(sentencecSimilarity.calculate_similarities(sentences))

# Return most similar sentence
print(sentencecSimilarity.return_most_similar(sentences)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

sentencesimilarity-0.1.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file sentencesimilarity-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sentencesimilarity-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for sentencesimilarity-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bc6706e8ff4b18a086ebc9fe30c26ad072ade3db4e4d224cae1cf3cea11a08f8
MD5 354bc32f5e03281defe6d02a90469770
BLAKE2b-256 bb2c2fe9dd9ce69ca90a157583eaed694286fb523ad26d983ea9285f71e3dc47

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