stance-pl / inference_utils.py
Dawid Motyka
app and model
834d42f
raw
history blame
No virus
501 Bytes
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