` ` ` bash
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
ImportError Traceback (the most recent call last)
----> 1 the from transformers import pipeline
2
3 NLP=pipeline (" sentiment analysis ")
4
5 the result=NLP (" I hate you ") [0]
ImportError: always import a name 'pipeline' from 'transformers' (unknown location)
` ` `
For Pipeline class unable to import as well,
Official 4.3.2 version of the document is written with the API interface, what I use is 4.3.2 version, but it is called the this error,
My environment is:
! [insert picture description here] (https://img-blog.csdnimg.cn/20210228210857233.png)
- Ananconda3 base environment
- python3.7
- tensorflow2.0.0
- transformers4.3.2
- jupyter notebook
Answer comment * *, * *
My original link: https://blog.csdn.net/qq_42658739/article/details/114239961