rahular commited on
Commit
52c6cb9
1 Parent(s): e3f9170

added example to README

Browse files
Files changed (2) hide show
  1. README.md +11 -0
  2. ibleu.py +1 -1
README.md CHANGED
@@ -10,3 +10,14 @@ pinned: false
10
  ---
11
 
12
  iBLEU measures the adequacy and dissimilarity of generated paraphrases.
 
 
 
 
 
 
 
 
 
 
 
 
10
  ---
11
 
12
  iBLEU measures the adequacy and dissimilarity of generated paraphrases.
13
+
14
+ Example:
15
+ ```
16
+ >>> inputs = ["greetings general kenobi", "foo foo bar bar"]
17
+ >>> predictions = ["hello there general kenobi", "foo bar foobar"]
18
+ >>> references = [["hello there general kenobi", "hello there !"], ["foo bar foobar", "foo bar foobar"]]
19
+ >>> ibleu = evaluate.load("rahular/ibleu")
20
+ >>> results = ibleu.compute(inputs=inputs, predictions=predictions, references=references)
21
+ >>> print(results)
22
+ {'score': 60.41585343630594}
23
+ ```
ibleu.py CHANGED
@@ -52,7 +52,7 @@ Args:
52
  use_effective_order (`bool`): If `True`, stops including n-gram orders for which precision is 0. This should be `True`, if sentence-level BLEU will be computed. Defaults to `False`.
53
  Returns:
54
  'score': iBLEU score,
55
- Examples:
56
  >>> inputs = ["greetings general kenobi", "foo foo bar bar"]
57
  >>> predictions = ["hello there general kenobi", "foo bar foobar"]
58
  >>> references = [["hello there general kenobi", "hello there !"], ["foo bar foobar", "foo bar foobar"]]
 
52
  use_effective_order (`bool`): If `True`, stops including n-gram orders for which precision is 0. This should be `True`, if sentence-level BLEU will be computed. Defaults to `False`.
53
  Returns:
54
  'score': iBLEU score,
55
+ Example:
56
  >>> inputs = ["greetings general kenobi", "foo foo bar bar"]
57
  >>> predictions = ["hello there general kenobi", "foo bar foobar"]
58
  >>> references = [["hello there general kenobi", "hello there !"], ["foo bar foobar", "foo bar foobar"]]