jgauthier commited on
Commit
c70b8db
1 Parent(s): 5cd2907

readme example fixes

Browse files
Files changed (1) hide show
  1. README.md +40 -3
README.md CHANGED
@@ -53,9 +53,46 @@ result = metric.compute(dataset=dataset["test"], model_id="gpt2")
53
 
54
  # Compute suite accuracy. Mean success over items, where "success" is the conjunction
55
  # of all boolean prediction results.
56
- suite_accuracies = [np.array(suite_results["prediction_results"]).all(axis=1).mean(axis=0)
57
- for suite_results in result.values()]
58
- overall_accuracy = np.mean(suite_accuracies.values())
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  ```
60
 
61
  ### Inputs
 
53
 
54
  # Compute suite accuracy. Mean success over items, where "success" is the conjunction
55
  # of all boolean prediction results.
56
+ suite_accuracies = {suite_name: np.array(suite_results["prediction_results"]).all(axis=1).mean(axis=0)
57
+ for suite_name, suite_results in result.items()}
58
+ overall_accuracy = np.mean(list(suite_accuracies.values()))
59
+ ```
60
+
61
+ ```python
62
+ >>> suite_accuracies
63
+ {'center_embed': 0.9285714285714286,
64
+ 'center_embed_mod': 0.8571428571428571,
65
+ 'cleft': 1.0,
66
+ 'cleft_modifier': 0.925,
67
+ 'fgd_hierarchy': 0.0,
68
+ 'fgd_object': 0.9583333333333334,
69
+ 'fgd_pp': 0.875,
70
+ 'fgd_subject': 0.5,
71
+ 'mvrr': 0.7857142857142857,
72
+ 'mvrr_mod': 0.75,
73
+ 'npi_orc_any': 0.9736842105263158,
74
+ 'npi_orc_ever': 1.0,
75
+ 'npi_src_any': 0.5789473684210527,
76
+ 'npi_src_ever': 0.9210526315789473,
77
+ 'npz_ambig': 0.9166666666666666,
78
+ 'npz_ambig_mod': 0.875,
79
+ 'npz_obj': 1.0,
80
+ 'npz_obj_mod': 1.0,
81
+ 'number_orc': 0.631578947368421,
82
+ 'number_prep': 0.7894736842105263,
83
+ 'number_src': 0.7894736842105263,
84
+ 'reflexive_orc_fem': 0.47368421052631576,
85
+ 'reflexive_orc_masc': 0.8421052631578947,
86
+ 'reflexive_prep_fem': 0.21052631578947367,
87
+ 'reflexive_prep_masc': 0.7894736842105263,
88
+ 'reflexive_src_fem': 0.15789473684210525,
89
+ 'reflexive_src_masc': 0.631578947368421,
90
+ 'subordination': 1.0,
91
+ 'subordination_orc-orc': 1.0,
92
+ 'subordination_pp-pp': 1.0,
93
+ 'subordination_src-src': 1.0}
94
+ >>> overall_accuracy
95
+ 0.7793839437302936
96
  ```
97
 
98
  ### Inputs