赞
踩
from transformers import AutoTokenizer, AutoModelForSequenceClassification, TextClassificationPipeline
model_name = 'qanastek/XLMRoberta-Alexa-Intents-Classification'
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
classifier = TextClassificationPipeline(model=model, tokenizer=tokenizer)
res = classifier("What's the weather like today?")
print(res)
# [{'label': 'weather_query', 'score': 0.9999779462814331}]
BERT for Joint Intent Classification and Slot Filling:https://arxiv.org/abs/1902.10909
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。