# This tokenizer cannot be instantiated. Please make sure you have `sentencepiece` installed in order to use this tokenizer.
!pip install sentencepiece
!pip install sacremoses
接著進行翻譯任務。
from transformers import pipeline
translator = pipeline("translation", model='Helsinki-NLP/opus-mt-zh-en') #使用翻譯任務
translator('這是一個很困難的問題')
# This tokenizer cannot be instantiated. Please make sure you have `sentencepiece` installed in order to use this tokenizer.
!pip install sentencepiece
!pip install sacremoses
接著進行翻譯任務。
from transformers import pipeline
translator = pipeline("translation", model='Helsinki-NLP/opus-mt-zh-en') #使用翻譯任務
translator('這是一個很困難的問題')