File size: 501 Bytes
834d42f
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
from typing import List, Dict
import pandas as pd

from preprocessing import format_masked_lm_prompt


def prepare_stance_texts(texts: List[str], targets: List[str], params: Dict[str, any], tokenizer):
    texts_df = pd.DataFrame({'text': texts, 'target': targets})
    prompt_text, prompt_target = format_masked_lm_prompt(texts_df, tokenizer=tokenizer,
                                                         prompt_type=params['masked_lm_prompt'], lang='pl',)
    return prompt_text, prompt_target