from transformers import pipeline nlp = pipeline("sentiment-analysis") def scoring(text): results = nlp(text) for result in results: score = result['score'] return score