from sentence_transformers import CrossEncoder # Load the pre-trained model model = CrossEncoder('cross-encoder/stsb-roberta-base') sentence_pairs = [] for sentence1, sentence2 in zip(stsb_test['sentence1'], stsb_test['sentence2']): sentence_pairs.append([sentence1, sentence2]) stsb_test['SBERT CrossEncoder_score'] = model.predict(sentence_pairs, show_progress_bar=True)