colbertv2 commited on
Commit
d01e011
·
1 Parent(s): b0e0d96

Update lotte_passages.py

Browse files
Files changed (1) hide show
  1. lotte_passages.py +49 -7
lotte_passages.py CHANGED
@@ -173,20 +173,62 @@ class NewDataset(datasets.GeneratorBasedBuilder):
173
 
174
  data = json.loads(row)
175
 
176
- for i in range(0, len(data)):
177
 
178
- current_query = data[i]
179
 
180
  if "author" in current_query.keys():
181
  author = current_query['author']
182
  else:
183
  author = ""
184
-
185
- yield i + 1, {
186
- "doc_id": current_query["doc_id"],
187
- "author": author,
188
- "text": current_query["text"]
189
  }
190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
 
192
 
 
173
 
174
  data = json.loads(row)
175
 
176
+ if len(data) == 3:
177
 
178
+ current_query = data#[i]
179
 
180
  if "author" in current_query.keys():
181
  author = current_query['author']
182
  else:
183
  author = ""
184
+
185
+ yield current_query["doc_id"], {
186
+ "doc_id": current_query["doc_id"],
187
+ "author": author,
188
+ "text": current_query["text"]
189
  }
190
 
191
+ else:
192
+
193
+ for i in range(0, len(data)):
194
+
195
+ assert len(data) == 268880 or len(data) == 119458 or len(data) == 2428763 or len(data) == 2818926 #lifestyle and pooled bug
196
+
197
+ if len(data) == 268880 or len(data) == 119458 or len(data) == 2428763 or len(data) == 2818926:
198
+
199
+ if len(data) == 268880:
200
+ current_query = {"doc_id": 0, "author": "Julie Baumler", "text": "In my experience rabbits are very easy to housebreak. They like to pee and poop in the same place every time, so in most cases all you have to do is put a little bit of their waste in the litter box and they will happily use the litter box. It is very important that if they go somewhere else, miss the edge or kick waste out of the box that you clean it up well and immediately as otherwise those spots will become existing places to pee and poop. When you clean the box, save a little bit of waste and put it in the cleaned box so it smells right to them. For a more foolproof method, you can get a piece of wood soaked with their urine and put that in the box along with droppings or cage them so that they are only in their litter box for a week. Generally, if I try the first method and find that they are not using only the box on the first day, I go for the litter box only for a week method. The wood block works well if you are moving from a hutch outdoors to a litter box indoors. If you have an indoor cage, you can use the cage itself as the litter box (or attach a litter box to the section of the cage the rabbit has used for waste.) Be sure to use clay or newsprint litter as the other types aren't necessarily good for rabbits. Wood litter is okay if you are sure it isn't fir. The most important thing is to clean anywhere they have an accident. High sided boxes help with avoiding kicking soiled litter out of the box, which is the biggest cause of failure in my experience."}
201
+ elif len(data) == 119458:
202
+ current_query = {"doc_id": 0, "author": "forefinger", "text": "Normal double-acting baking powder makes CO2 (thus giving a rising effect) in two ways: when it gets wet, and when it is heated. Baking soda only makes CO2 when it gets wet. From Wikipedia: The acid in a baking powder can be either fast-acting or slow-acting.[6] A fast-acting acid reacts in a wet mixture with baking soda at room temperature, and a slow-acting acid will not react until heated in an oven. Baking powders that contain both fast- and slow-acting acids are double acting; those that contain only one acid are single acting. By providing a second rise in the oven, double-acting baking powders increase the reliability of baked goods by rendering the time elapsed between mixing and baking less critical, and this is the type most widely available to consumers today."}
203
+ elif len(data) == 2428763:
204
+ current_query = {"doc_id": 0, "author": "", "text": "A native speaker would interpret them as having the same meaning. You could say \"I'm ill,\" or you could say \"I'm sick\". \"I'm ill\" could be classed as more formal language."}
205
+ elif len(data) == 2818926:
206
+ current_query = {"doc_id": 0, "author": "", "text": "It's the fifth element after earth, air, fire, and water, so it is presumably superior to those or completing those."}
207
+
208
+ if first_row:
209
+ if "author" in current_query.keys():
210
+ author = current_query['author']
211
+ else:
212
+ author = ""
213
+
214
+ yield i, {
215
+ "doc_id": current_query["doc_id"],
216
+ "author": author,
217
+ "text": current_query["text"]
218
+ }
219
+ first_row = False
220
+
221
+ current_query = data[i]
222
+
223
+ if "author" in current_query.keys():
224
+ author = current_query['author']
225
+ else:
226
+ author = ""
227
+
228
+ yield i + 1, {
229
+ "doc_id": current_query["doc_id"],
230
+ "author": author,
231
+ "text": current_query["text"]
232
+ }
233
 
234