Instructions to use ihgn/Discriminator-Paraphrase with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ihgn/Discriminator-Paraphrase with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ihgn/Discriminator-Paraphrase")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("ihgn/Discriminator-Paraphrase") model = AutoModelForSequenceClassification.from_pretrained("ihgn/Discriminator-Paraphrase") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
tokenizer = BartTokenizer.from_pretrained('ihgn/paraphrase-detection')
|
| 2 |
model = BartForConditionalGeneration.from_pretrained("ihgn/paraphrase-detection").to(device)
|
| 3 |
source_sentence = "This was a series of nested angular standards , so that measurements in azimuth and elevation could be done directly in polar coordinates relative to the ecliptic."
|
|
@@ -15,4 +18,4 @@
|
|
| 15 |
predicted_label = 1 if generated_text == '1' else 0
|
| 16 |
print("Predicted Label:", predicted_label)
|
| 17 |
|
| 18 |
-
paraphrase_detection(model, tokenizer, source_sentence, target_paraphrase)
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pipeline_tag: text-classification
|
| 3 |
+
---
|
| 4 |
tokenizer = BartTokenizer.from_pretrained('ihgn/paraphrase-detection')
|
| 5 |
model = BartForConditionalGeneration.from_pretrained("ihgn/paraphrase-detection").to(device)
|
| 6 |
source_sentence = "This was a series of nested angular standards , so that measurements in azimuth and elevation could be done directly in polar coordinates relative to the ecliptic."
|
|
|
|
| 18 |
predicted_label = 1 if generated_text == '1' else 0
|
| 19 |
print("Predicted Label:", predicted_label)
|
| 20 |
|
| 21 |
+
paraphrase_detection(model, tokenizer, source_sentence, target_paraphrase)
|