Viswadarshan R R commited on
Commit
fa03822
·
verified ·
1 Parent(s): f31b56e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +151 -3
README.md CHANGED
@@ -1,3 +1,151 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - nyu-mll/glue
5
+ - AlekseyKorshuk/quora-question-pairs
6
+ - google-research-datasets/paws-x
7
+ - tasksource/pit
8
+ metrics:
9
+ - accuracy
10
+ - f1
11
+ base_model:
12
+ - FacebookAI/roberta-base
13
+ library_name: transformers
14
+ ---
15
+ # Model Card for Fine-Tuned RoBERTa for Paraphrase Detection
16
+
17
+ ### Model Description
18
+ This is a fine-tuned version of **RoBERTa-base** for **paraphrase detection**, trained on four benchmark datasets: **MRPC, QQP, PAWS-X, and PIT**. The model is designed for applications like **duplicate content detection, question answering, and semantic similarity analysis**. It demonstrates high performance across varied linguistic structures.
19
+
20
+ - **Developed by:** Viswadarshan R R
21
+ - **Model Type:** Transformer-based Sentence Pair Classifier
22
+ - **Language:** English
23
+ - **Finetuned from:** `FacebookAI/roberta-base`
24
+
25
+ ### Model Sources
26
+
27
+ - **Repository:** [Hugging Face Model Hub](https://huggingface.co/viswadarshan06/pd-bert/)
28
+ - **Research Paper:** _Comparative Insights into Modern Architectures for Paraphrase Detection_ (Accepted at ICCIDS 2025)
29
+ - **Demo:** (To be added upon deployment)
30
+
31
+ ## Uses
32
+
33
+ ### Direct Use
34
+ - Identifying **duplicate questions** in FAQs and customer support.
35
+ - Improving **semantic search** in information retrieval systems.
36
+ - Enhancing **document deduplication** and content moderation.
37
+
38
+ ### Downstream Use
39
+ The model can be further fine-tuned on domain-specific paraphrase datasets (e.g., medical, legal, or finance).
40
+
41
+ ### Out-of-Scope Use
42
+ - The model is not designed for multilingual paraphrase detection since it is trained only on English datasets.
43
+ - May not perform well on low-resource languages without additional fine-tuning.
44
+
45
+ ## Bias, Risks, and Limitations
46
+
47
+ ### Known Limitations
48
+ - Struggles with idiomatic expressions: The model finds it difficult to detect paraphrases in figurative language.
49
+ - Contextual ambiguity: May fail when sentences require deep contextual reasoning.
50
+
51
+ ### Recommendations
52
+ Users should fine-tune the model with additional cultural and idiomatic datasets for improved generalization in real-world applications.
53
+
54
+ ## How to Get Started with the Model
55
+
56
+ To use the model, install **transformers** and load the fine-tuned model as follows:
57
+
58
+ ```python
59
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
60
+
61
+ # Load the tokenizer and model
62
+ model_path = "your-huggingface-model-id"
63
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
64
+ model = AutoModelForSequenceClassification.from_pretrained(model_path)
65
+
66
+ # Encode sentence pairs
67
+ inputs = tokenizer("The car is fast.", "The vehicle moves quickly.", return_tensors="pt", padding=True, truncation=True)
68
+
69
+ # Get predictions
70
+ outputs = model(**inputs)
71
+ logits = outputs.logits
72
+ predicted_class = logits.argmax().item()
73
+
74
+ print("Paraphrase" if predicted_class == 1 else "Not a Paraphrase")
75
+ ```
76
+
77
+ ## Training Details
78
+ This model was trained using a combination of four datasets:
79
+
80
+ - **MRPC**: News-based paraphrases.
81
+ - **QQP**: Duplicate question detection.
82
+ - **PAWS-X**: Adversarial paraphrases for robustness testing.
83
+ - **PIT**: Short-text paraphrase dataset.
84
+
85
+ ### Training Procedure
86
+
87
+ - **Tokenizer**: RobertaTokenizer
88
+ - **Batch Size**: 16
89
+ - **Optimizer**: AdamW
90
+ - **Loss Function**: Cross-entropy
91
+
92
+ #### Training Hyperparameters
93
+ - **Learning Rate**: 2e-5
94
+ - **Sequence Length**:
95
+ - MRPC: 256
96
+ - QQP: 336
97
+ - PIT: 64
98
+ - PAWS-X: 256
99
+
100
+ #### Speeds, Sizes, Times
101
+
102
+ - **GPU Used**: NVIDIA A100
103
+ - **Total Training Time**: ~6 hours
104
+ - **Compute Units Used**: 80
105
+
106
+ ### Testing Data, Factors & Metrics
107
+ #### Testing Data
108
+
109
+ The model was tested on combined test sets and evaluated on:
110
+ - Accuracy
111
+ - Precision
112
+ - Recall
113
+ - F1-Score
114
+ - Runtime
115
+
116
+ ### Results
117
+
118
+ ## **RoBERTa Model Evaluation Metrics**
119
+ | Model | Dataset | Accuracy (%) | Precision (%) | Recall (%) | F1-Score (%) | Runtime (sec) |
120
+ |---------|------------|-------------|--------------|------------|-------------|---------------|
121
+ | RoBERTa | MRPC Validation | 89.22 | 89.56 | 95.34 | 92.36 | 5.08 |
122
+ | RoBERTa | MRPC Test | 87.65 | 88.53 | 93.55 | 90.97 | 21.98 |
123
+ | RoBERTa | QQP Validation | 89.17 | 84.38 | 86.48 | 85.42 | 8.32 |
124
+ | RoBERTa | QQP Test | 89.36 | 85.14 | 86.56 | 85.84 | 19.44 |
125
+ | RoBERTa | PAWS-X Validation | 94.75 | 92.58 | 95.48 | 94.01 | 7.78 |
126
+ | RoBERTa | PAWS-X Test | 94.60 | 92.82 | 95.48 | 94.13 | 7.88 |
127
+ | RoBERTa | PIT Validation | 82.28 | 82.57 | 63.47 | 71.77 | 7.01 |
128
+ | RoBERTa | PIT Test | 90.45 | 84.67 | 66.29 | 74.35 | 1.47 |
129
+
130
+ ### Summary
131
+ This RoBERTa-based Paraphrase Detection Model has been fine-tuned on four benchmark datasets: MRPC, QQP, PAWS-X, and PIT, enabling robust performance across diverse paraphrase structures. The model effectively identifies semantic similarity between sentence pairs, making it suitable for applications like semantic search, duplicate content detection, and question answering systems.
132
+
133
+ ### **Citation**
134
+
135
+ If you use this model, please cite:
136
+
137
+ ```bibtex
138
+ @inproceedings{viswadarshan2025paraphrase,
139
+ title={Comparative Insights into Modern Architectures for Paraphrase Detection},
140
+ author={Viswadarshan R R},
141
+ booktitle={International Conference on Computational Intelligence, Data Science, and Security (ICCIDS)},
142
+ year={2025},
143
+ publisher={IFIP AICT Series by Springer}
144
+ }
145
+ ```
146
+
147
+ ## Model Card Contact
148
+
149
+ 📧 Email: viswadarshanrramiya@gmail.com
150
+
151
+ 🔗 GitHub: [Viswadarshan R R](https://github.com/viswadarshan-024)