"examples/vscode:/vscode.git/clone" did not exist on "b90b0570926083771ac838cc7906f31d88ba9f49"
Commit 4923a7ce authored by lintangsutawika's avatar lintangsutawika
Browse files

fixed process

parent e786cbac
...@@ -4,9 +4,9 @@ def doc_to_text(x): ...@@ -4,9 +4,9 @@ def doc_to_text(x):
def _mark_span(text, span_str, span_idx, mark): def _mark_span(text, span_str, span_idx, mark):
pattern_tmpl = r'^((?:\S+\s){N})(W)' pattern_tmpl = r'^((?:\S+\s){N})(W)'
pattern = re.sub(pattern_tmpl, 'N', str(span_idx)) pattern = re.sub('N', str(span_idx), pattern_tmpl)
pattern = re.sub(pattern, 'W', span_str) pattern = re.sub('W', span_str, pattern)
return re.sub(text, pattern, r'\1{0} \2 {0}'.format(mark)) return re.sub(pattern, r'\1{0} \2 {0}'.format(mark), text)
text = x['text'] text = x['text']
text = _mark_span(text, x['span1_text'], x['span1_index'], '*') text = _mark_span(text, x['span1_text'], x['span1_index'], '*')
......
...@@ -7,7 +7,7 @@ dataset_name: wsc ...@@ -7,7 +7,7 @@ dataset_name: wsc
training_split: train training_split: train
validation_split: validation validation_split: validation
doc_to_text: !function "preprocess_wsc.doc_to_text" doc_to_text: !function "preprocess_wsc.doc_to_text"
doc_to_target: "{{candidates[label]}}" doc_to_target: "{% set answer_choices = ['False', 'True'] %}{{answer_choices[label]}}"
metric_list: metric_list:
- metric: exact_match - metric: exact_match
aggregation: mean aggregation: mean
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment