Drunper commited on
Commit
389a2f6
1 Parent(s): 6aa51b8
Files changed (2) hide show
  1. metrica_tesi.py +1 -1
  2. tests.py +3 -0
metrica_tesi.py CHANGED
@@ -95,7 +95,7 @@ class MetricaTesi(evaluate.Metric):
95
  # TODO: Download external resources if needed
96
  pass
97
 
98
- def _compute(self, predictions, references, n):
99
  """Returns the scores"""
100
  # TODO: Compute the different scores of the module
101
  score = 0
 
95
  # TODO: Download external resources if needed
96
  pass
97
 
98
+ def _compute(self, predictions, references, n=2):
99
  """Returns the scores"""
100
  # TODO: Compute the different scores of the module
101
  score = 0
tests.py CHANGED
@@ -2,16 +2,19 @@ test_cases = [
2
  {
3
  "predictions": ["blu red yellow", "green orange violet"],
4
  "references": ["pizza spaghetti mandolino", "piplup prinplup empoleon"],
 
5
  "result": {"metric_score": 0}
6
  },
7
  {
8
  "predictions": ["a random string", "another string maybe"],
9
  "references": ["random random string", "string string maybe"],
 
10
  "result": {"metric_score": 1}
11
  },
12
  {
13
  "predictions": ["conda search evaluate", "conda search transformers"],
14
  "references": ["conda search evaluate", "conda install pytorch"],
 
15
  "result": {"metric_score": 0.5}
16
  }
17
  ]
 
2
  {
3
  "predictions": ["blu red yellow", "green orange violet"],
4
  "references": ["pizza spaghetti mandolino", "piplup prinplup empoleon"],
5
+ "n": 2,
6
  "result": {"metric_score": 0}
7
  },
8
  {
9
  "predictions": ["a random string", "another string maybe"],
10
  "references": ["random random string", "string string maybe"],
11
+ "n": 2,
12
  "result": {"metric_score": 1}
13
  },
14
  {
15
  "predictions": ["conda search evaluate", "conda search transformers"],
16
  "references": ["conda search evaluate", "conda install pytorch"],
17
+ "n": 2,
18
  "result": {"metric_score": 0.5}
19
  }
20
  ]