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") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -45,3 +45,16 @@ Code output is:
|
|
| 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".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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".
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
# Evaluation results
|
| 52 |
+
|
| 53 |
+
We have used as test dataset 16500 pairs of phrases human tagged.
|
| 54 |
+
|
| 55 |
+
Metrics obtained are:
|
| 56 |
+
|
| 57 |
+
```
|
| 58 |
+
metrics={'test_loss': 0.5660144090652466, 'test_accuracy': 0.8170742794799527, 'test_precision': 0.7043977055449331, 'test_recall': 0.5978578383641675, 'test_f1': 0.6467696629213483, 'test_matthews_correlation': 0.5276716223607356, 'test_runtime': 19.3345, 'test_samples_per_second': 568.88, 'test_steps_per_second': 17.792}
|
| 59 |
+
|
| 60 |
+
```
|