直接参考官方文档(https://huggingface.co/learn/nlp-course/chapter1/3)的代码: from transformers import pipeline classifier = pipeline("sentiment-analysis") classifier("I've been waiting for a HuggingFace course my whole life.") 发现代码不能正常直接运行 分析后发现需要Pytorch或者TensorFLow, ...