mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
update (#251)
This commit is contained in:
parent
1034c487ef
commit
01372a4806
@ -43,15 +43,16 @@ def crowspairs_postprocess(text: str) -> str:
|
|||||||
if re.search('Neither', text) or re.search('Both', text):
|
if re.search('Neither', text) or re.search('Both', text):
|
||||||
return 'invalid'
|
return 'invalid'
|
||||||
|
|
||||||
first_option = text[0]
|
if text != '':
|
||||||
if first_option.isupper() and first_option in 'AB':
|
first_option = text[0]
|
||||||
return first_option
|
if first_option.isupper() and first_option in 'AB':
|
||||||
|
return first_option
|
||||||
|
|
||||||
if re.search(' A ', text) or re.search('A.', text):
|
if re.search(' A ', text) or re.search('A.', text):
|
||||||
return 'A'
|
return 'A'
|
||||||
|
|
||||||
if re.search(' B ', text) or re.search('B.', text):
|
if re.search(' B ', text) or re.search('B.', text):
|
||||||
return 'B'
|
return 'B'
|
||||||
|
|
||||||
return 'invalid'
|
return 'invalid'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user