File size: 4,076 Bytes
a83b951 6e43699 531cd67 a83b951 423d628 a83b951 423d628 a83b951 6e43699 a5315cd 6e43699 a5315cd 6e43699 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
---
annotations_creators:
- expert-generated
language:
- en
language_creators:
- found
multilinguality:
- monolingual
size_categories:
- 100K<n<1M
task_categories:
- feature-extraction
- sentence-similarity
pretty_name: Quora Duplicate Questions
tags:
- sentence-transformers
- evaluation
dataset_info:
- config_name: duplicates
features:
- name: qid1
dtype: string
- name: qid2
dtype: string
splits:
- name: train
num_bytes: 4091278
num_examples: 217838
- name: dev
num_bytes: 382130
num_examples: 20017
- name: test
num_bytes: 1222432
num_examples: 65350
download_size: 4513329
dataset_size: 5695840
- config_name: questions
features:
- name: question
dtype: string
- name: qid
dtype: string
splits:
- name: train
num_bytes: 28494589
num_examples: 376493
- name: dev
num_bytes: 4060422
num_examples: 53485
- name: test
num_bytes: 8163310
num_examples: 107953
download_size: 28791952
dataset_size: 40718321
configs:
- config_name: duplicates
data_files:
- split: train
path: duplicates/train-*
- split: dev
path: duplicates/dev-*
- split: test
path: duplicates/test-*
- config_name: questions
data_files:
- split: train
path: questions/train-*
- split: dev
path: questions/dev-*
- split: test
path: questions/test-*
---
# Dataset Card for Quora Duplicate Questions
This dataset contains the [Quora](https://huggingface.co/datasets/quora) Question Pairs dataset in a format that is easily used with the [`ParaphraseMiningEvaluator`](https://sbert.net/docs/package_reference/evaluation.html#sentence_transformers.evaluation.ParaphraseMiningEvaluator) evaluator in Sentence Transformers. The data was originally created by Quora for [this Kaggle Competition](https://www.kaggle.com/c/quora-question-pairs).
## Usage
```python
from datasets import load_dataset
from sentence_transformers.SentenceTransformer import SentenceTransformer
from sentence_transformers.evaluation import ParaphraseMiningEvaluator
# Load the Quora Duplicates Mining dataset
questions_dataset = load_dataset("sentence-transformers/quora-duplicates-mining", "questions", split="dev")
duplicates_dataset = load_dataset("sentence-transformers/quora-duplicates-mining", "duplicates", split="dev")
# Create a mapping from qid to question & a list of duplicates (qid1, qid2)
qid_to_questions = dict(zip(questions_dataset["qid"], questions_dataset["question"]))
duplicates = list(zip(duplicates_dataset["qid1"], duplicates_dataset["qid2"]))
# Initialize the paraphrase mining evaluator
paraphrase_mining_evaluator = ParaphraseMiningEvaluator(qid_to_questions, duplicates, name="quora-duplicates-dev")
# Load a model to evaluate
model = SentenceTransformer("all-MiniLM-L6-v2")
results = paraphrase_mining_evaluator(model)
print(results)
```
```
{
'quora-duplicates-dev_average_precision': 0.5537837023752262,
'quora-duplicates-dev_f1': 0.542585123346778,
'quora-duplicates-dev_precision': 0.5112918195076678,
'quora-duplicates-dev_recall': 0.5779587350751861,
'quora-duplicates-dev_threshold': 0.8290803134441376,
}
```
## Dataset Subsets
### `questions` subset
* Columns: "question", "qid"
* Column types: `str`, `str`
* Examples:
```python
{
'question': 'How do I prepare for TCS IT Wiz?',
'qid': '107646',
}
```
* Collection strategy: A direct copy of the `quora-IR-dataset/duplicate-mining` as generated from [`create_splits.py`](https://github.com/UKPLab/sentence-transformers/tree/master/examples/training/quora_duplicate_questions/create_splits.py).
* Deduplified: No
### `duplicates` subset
* Columns: "qid1", "qid2"
* Column types: `str`, `str`
* Examples:
```python
{
'qid1': '43345',
'qid2': '43346',
}
```
* Collection strategy: A direct copy of the `quora-IR-dataset/duplicate-mining` as generated from [`create_splits.py`](https://github.com/UKPLab/sentence-transformers/tree/master/examples/training/quora_duplicate_questions/create_splits.py).
* Deduplified: No |