📜  nlp - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:08.007000             🧑  作者: Mango

代码示例1
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification
from transformers import pipeline
 
tokenizer = AutoTokenizer.from_pretrained("tblard/tf-allocine", use_fast=True)
model = TFAutoModelForSequenceClassification.from_pretrained("tblard/tf-allocine")
 
nlp = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)