Zongxia commited on
Commit
41070e7
1 Parent(s): 15223c4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +17 -7
README.md CHANGED
@@ -72,17 +72,27 @@ F1 Match: False
72
  '''
73
  ```
74
 
75
- #### PANDA
76
  ```python
77
- from qa_metrics.cfm import CFMatcher
78
 
79
  question = "Which movie is loosley based off the Brother Grimm's Iron Henry?"
80
- cfm = CFMatcher()
81
- scores = cfm.get_scores(reference_answer, candidate_answer, question)
82
- match_result = cfm.cf_match(reference_answer, candidate_answer, question)
83
- print("Score: %s; PD Match: %s" % (scores, match_result))
 
 
84
  '''
85
- Score: {'the frog prince': {'The movie "The Princess and the Frog" is loosely based off the Brother Grimm\'s "Iron Henry"': 0.7131625951317375}, 'the princess and the frog': {'The movie "The Princess and the Frog" is loosely based off the Brother Grimm\'s "Iron Henry"': 0.854451712151719}}; PD Match: True
 
 
 
 
 
 
 
 
86
  '''
87
  ```
88
 
 
72
  '''
73
  ```
74
 
75
+ #### PANDA Match
76
  ```python
77
+ from qa_metrics.pedant import PEDANT
78
 
79
  question = "Which movie is loosley based off the Brother Grimm's Iron Henry?"
80
+ pedant = PEDANT()
81
+ scores = pedant.get_scores(reference_answer, candidate_answer, question)
82
+ max_pair, highest_scores = pedant.get_highest_score(reference_answer, candidate_answer, question)
83
+ match_result = pedant.evaluate(reference_answer, candidate_answer, question)
84
+ print("Max Pair: %s; Highest Score: %s" % (max_pair, highest_scores))
85
+ print("Score: %s; PANDA Match: %s" % (scores, match_result))
86
  '''
87
+ Max Pair: ('the princess and the frog', 'The movie "The Princess and the Frog" is loosely based off the Brother Grimm\'s "Iron Henry"'); Highest Score: 0.854451712151719
88
+ Score: {'the frog prince': {'The movie "The Princess and the Frog" is loosely based off the Brother Grimm\'s "Iron Henry"': 0.7131625951317375}, 'the princess and the frog': {'The movie "The Princess and the Frog" is loosely based off the Brother Grimm\'s "Iron Henry"': 0.854451712151719}}; PANDA Match: True
89
+ '''
90
+ ```
91
+
92
+ ```python
93
+ print(pedant.get_score(reference_answer[1], candidate_answer, question))
94
+ '''
95
+ 0.7122460127464126
96
  '''
97
  ```
98