added example to README
Browse files
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 |
-
|
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"]]
|