Instructions to use Prompsit/paraphrase-bert-en with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Prompsit/paraphrase-bert-en with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Prompsit/paraphrase-bert-en")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Prompsit/paraphrase-bert-en") model = AutoModelForSequenceClassification.from_pretrained("Prompsit/paraphrase-bert-en", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
f004aab
1
Parent(s): 1a86eb3
Update README.md
Browse files
README.md
CHANGED
|
@@ -23,7 +23,9 @@ Resulting probabilities correspond to classes:
|
|
| 23 |
* 1: It's a paraphrase
|
| 24 |
|
| 25 |
|
| 26 |
-
|
|
|
|
|
|
|
| 27 |
|
| 28 |
```
|
| 29 |
import torch
|
|
@@ -41,4 +43,5 @@ Code output is:
|
|
| 41 |
```
|
| 42 |
tensor([[0.1592, 0.8408]], grad_fn=<SoftmaxBackward>)
|
| 43 |
```
|
| 44 |
-
|
|
|
|
|
|
| 23 |
* 1: It's a paraphrase
|
| 24 |
|
| 25 |
|
| 26 |
+
|
| 27 |
+
So, considering the phrase "may be addressed" and a candidate paraphrase like "could be included", you can use the model like this:
|
| 28 |
+
|
| 29 |
|
| 30 |
```
|
| 31 |
import torch
|
|
|
|
| 43 |
```
|
| 44 |
tensor([[0.1592, 0.8408]], grad_fn=<SoftmaxBackward>)
|
| 45 |
```
|
| 46 |
+
|
| 47 |
+
As the probability of 1 (=It's a paraphrase) is 0.84 and the probability of 0 (=It is not a paraphrase) is 0.15, we can conclude, for our previous example that "could be included" is a paraphrase of "may be addressed".
|