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

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

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page