cointegrated / rubert-base-cased-dp-paraphrase-detection

huggingface.co
Total runs: 48
24-hour runs: 0
7-day runs: 5
30-day runs: 38
Model's Last Updated: June 23 2023
text-classification

Introduction of rubert-base-cased-dp-paraphrase-detection

Model Details of rubert-base-cased-dp-paraphrase-detection

This is a version of paraphrase detector by DeepPavlov ( details in the documentation ) ported to the Transformers format.

All credit goes to the authors of DeepPavlov.

The model has been trained on the dataset from http://paraphraser.ru/ .

It classifies texts as paraphrases (class 1) or non-paraphrases (class 0).

import torch
from transformers import AutoModelForSequenceClassification, BertTokenizer
model_name = 'cointegrated/rubert-base-cased-dp-paraphrase-detection'
model = AutoModelForSequenceClassification.from_pretrained(model_name).cuda()
tokenizer = BertTokenizer.from_pretrained(model_name)

def compare_texts(text1, text2):
    batch = tokenizer(text1, text2, return_tensors='pt').to(model.device)
    with torch.inference_mode():
        proba = torch.softmax(model(**batch).logits, -1).cpu().numpy()
    return proba[0] # p(non-paraphrase), p(paraphrase)

print(compare_texts('Сегодня на улице хорошая погода', 'Сегодня на улице отвратительная погода'))
# [0.7056226 0.2943774]
print(compare_texts('Сегодня на улице хорошая погода', 'Отличная погодка сегодня выдалась'))
# [0.16524374 0.8347562 ]

P.S. In the DeepPavlov repository, the tokenizer uses max_seq_length=64 . This model, however, uses model_max_length=512 . Therefore, the results on long texts may be inadequate.

Runs of cointegrated rubert-base-cased-dp-paraphrase-detection on huggingface.co

48
Total runs
0
24-hour runs
3
3-day runs
5
7-day runs
38
30-day runs

More Information About rubert-base-cased-dp-paraphrase-detection huggingface.co Model

rubert-base-cased-dp-paraphrase-detection huggingface.co

rubert-base-cased-dp-paraphrase-detection huggingface.co is an AI model on huggingface.co that provides rubert-base-cased-dp-paraphrase-detection's model effect (), which can be used instantly with this cointegrated rubert-base-cased-dp-paraphrase-detection model. huggingface.co supports a free trial of the rubert-base-cased-dp-paraphrase-detection model, and also provides paid use of the rubert-base-cased-dp-paraphrase-detection. Support call rubert-base-cased-dp-paraphrase-detection model through api, including Node.js, Python, http.

rubert-base-cased-dp-paraphrase-detection huggingface.co Url

https://huggingface.co/cointegrated/rubert-base-cased-dp-paraphrase-detection

cointegrated rubert-base-cased-dp-paraphrase-detection online free

rubert-base-cased-dp-paraphrase-detection huggingface.co is an online trial and call api platform, which integrates rubert-base-cased-dp-paraphrase-detection's modeling effects, including api services, and provides a free online trial of rubert-base-cased-dp-paraphrase-detection, you can try rubert-base-cased-dp-paraphrase-detection online for free by clicking the link below.

cointegrated rubert-base-cased-dp-paraphrase-detection online free url in huggingface.co:

https://huggingface.co/cointegrated/rubert-base-cased-dp-paraphrase-detection

rubert-base-cased-dp-paraphrase-detection install

rubert-base-cased-dp-paraphrase-detection is an open source model from GitHub that offers a free installation service, and any user can find rubert-base-cased-dp-paraphrase-detection on GitHub to install. At the same time, huggingface.co provides the effect of rubert-base-cased-dp-paraphrase-detection install, users can directly use rubert-base-cased-dp-paraphrase-detection installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

rubert-base-cased-dp-paraphrase-detection install url in huggingface.co:

https://huggingface.co/cointegrated/rubert-base-cased-dp-paraphrase-detection

Url of rubert-base-cased-dp-paraphrase-detection

rubert-base-cased-dp-paraphrase-detection huggingface.co Url

Provider of rubert-base-cased-dp-paraphrase-detection huggingface.co

cointegrated
ORGANIZATIONS

Other API from cointegrated