Skip to main content

Mutual implication score: a symmetric measure of text semantic similarity based on a RoBERTA model pretrained for natural language inference.

Project description

mutual_implication_score

Mutual implication score: a symmetric measure of text semantic similarity based on a RoBERTA model pretrained for natural language inference and fine-tuned for paraphrase detection.

The following snippet illustrates code usage:

from mutual_implication_score import MIS
mis = MIS(device='cpu')
source_texts = ['I want to leave this room',
                'Hello world, my name is Nick']
paraphrases = ['I want to go out of this room',
               'Hello world, my surname is Petrov']
scores = mis.compute(source_texts, paraphrases)
print(scores)
# expected output: [0.9748, 0.0545]

The first two texts are semantically equivalent, their MIS is close to 1. The two other texts have different meanings, and their score is low.

By default, the model https://huggingface.co/SkolkovoInstitute/Mutual_Implication_Score is used, but you can provide any other compatible model.

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

mutual_implication_score-0.0.0.tar.gz (3.3 kB view details)

Uploaded Source

File details

Details for the file mutual_implication_score-0.0.0.tar.gz.

File metadata

File hashes

Hashes for mutual_implication_score-0.0.0.tar.gz
Algorithm Hash digest
SHA256 512816e65582de6758e2e73b02bdee6324a21cf22a40616210a044e71f63fdc3
MD5 07621975a7f2f6004c554ceea378907b
BLAKE2b-256 37d7b1467f01c33395009a4fcc1743f72daf0f3d837a68a947a8d6660ececbd7

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