qgyd2021 commited on
Commit
226931f
1 Parent(s): 56ef98f

[update]add diac2019

Browse files
data/diac2019.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5a589eb5afaba02a3c78f2980442e4c2d5ea1090217e06fd909d5b94b5b8ded3
3
- size 36910626
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:53152ee55eb4f7cca67b68a4a3cfbcf2e0c8dcfe8f7729335e615521546866ba
3
+ size 36898086
examples/preprocess/process_diac2019.py CHANGED
@@ -46,8 +46,8 @@ def main():
46
  equal = group[0]
47
  not_equal = group[1]
48
 
49
- equal_questions = [question.text for question in equal]
50
- not_equal_questions = [question.text for question in not_equal]
51
 
52
  pairs = set()
53
 
@@ -55,6 +55,8 @@ def main():
55
  for q2 in equal_questions:
56
  if q1 == q2:
57
  continue
 
 
58
  pair = (q1, q2, 1)
59
  pairs.add(pair)
60
 
@@ -62,6 +64,8 @@ def main():
62
  for q2 in not_equal_questions:
63
  if q1 == q2:
64
  continue
 
 
65
  pair = (q1, q2, 0)
66
  pairs.add(pair)
67
 
@@ -91,6 +95,8 @@ def main():
91
 
92
  question1 = row["question1"]
93
  question2 = row["question2"]
 
 
94
 
95
  json_row = {
96
  "sentence1": question1,
@@ -111,6 +117,8 @@ def main():
111
 
112
  question1 = row["question1"]
113
  question2 = row["question2"]
 
 
114
 
115
  json_row = {
116
  "sentence1": question1,
 
46
  equal = group[0]
47
  not_equal = group[1]
48
 
49
+ equal_questions = [question.text for question in equal if question.text is not None]
50
+ not_equal_questions = [question.text for question in not_equal if question.text is not None]
51
 
52
  pairs = set()
53
 
 
55
  for q2 in equal_questions:
56
  if q1 == q2:
57
  continue
58
+ if q1 is None or q2 is None:
59
+ continue
60
  pair = (q1, q2, 1)
61
  pairs.add(pair)
62
 
 
64
  for q2 in not_equal_questions:
65
  if q1 == q2:
66
  continue
67
+ if q1 is None or q2 is None:
68
+ continue
69
  pair = (q1, q2, 0)
70
  pairs.add(pair)
71
 
 
95
 
96
  question1 = row["question1"]
97
  question2 = row["question2"]
98
+ if question1 is None or question2 is None:
99
+ continue
100
 
101
  json_row = {
102
  "sentence1": question1,
 
117
 
118
  question1 = row["question1"]
119
  question2 = row["question2"]
120
+ if question1 is None or question2 is None:
121
+ continue
122
 
123
  json_row = {
124
  "sentence1": question1,
main.py CHANGED
@@ -4,10 +4,10 @@ from datasets import load_dataset
4
 
5
  dataset = load_dataset(
6
  "sentence_pair.py",
7
- name="ccks2018_task3",
8
- split="validation",
9
  )
10
-
11
  for sample in dataset:
12
  print(sample)
13
 
 
4
 
5
  dataset = load_dataset(
6
  "sentence_pair.py",
7
+ name="diac2019",
8
+ # split="validation",
9
  )
10
+ print(dataset)
11
  for sample in dataset:
12
  print(sample)
13