yangwang825 commited on
Commit
f56951b
1 Parent(s): e571989

Update datastats.py

Browse files
Files changed (1) hide show
  1. datastats.py +5 -5
datastats.py CHANGED
@@ -271,8 +271,8 @@ class DataStats(evaluate.Metric):
271
  features=[
272
  datasets.Features(
273
  {
274
- "summaries": datasets.Value("string", id="sequence"),
275
- "documents": datasets.Value("string", id="sequence"),
276
  }
277
  ),
278
  ],
@@ -285,8 +285,8 @@ class DataStats(evaluate.Metric):
285
 
286
  def _compute(
287
  self,
288
- summaries,
289
- documents,
290
  n_gram: int = 3,
291
  n_workers: int = 4,
292
  lowercase: bool = False,
@@ -296,7 +296,7 @@ class DataStats(evaluate.Metric):
296
  # logger.info(predictions)
297
  # logger.info(references)
298
  datastats = DataStatsMetric(n_gram, n_workers, lowercase, tokenize)
299
- results = datastats.evaluate_batch(summaries, documents)
300
  coverage = float(results['coverage'])
301
  density = float(results['density'])
302
  compression = float(results['compression'])
 
271
  features=[
272
  datasets.Features(
273
  {
274
+ "predictions": datasets.Value("string", id="sequence"),
275
+ "references": datasets.Value("string", id="sequence"),
276
  }
277
  ),
278
  ],
 
285
 
286
  def _compute(
287
  self,
288
+ predictions,
289
+ references,
290
  n_gram: int = 3,
291
  n_workers: int = 4,
292
  lowercase: bool = False,
 
296
  # logger.info(predictions)
297
  # logger.info(references)
298
  datastats = DataStatsMetric(n_gram, n_workers, lowercase, tokenize)
299
+ results = datastats.evaluate_batch(predictions, references)
300
  coverage = float(results['coverage'])
301
  density = float(results['density'])
302
  compression = float(results['compression'])