Question regarding Transformer's pipeline module [D]
About this article
from transformers import pipeline , DistilBertTokenizer , DistilBertModel model = DistilBertModel . from_pretrained ('distilbert-base-cased-distilled-squad') # Load a model that is already trained on Question Answering extractor = pipeline ("question-answering") def get_emotion_cause (text, emotion): question = f"Show the reason why the text convey {emotion} symptoms?" # The model extracts the 'cause' span from the text result = extractor(question = question, context = text) return result ['a...
You've been blocked by network security.To continue, log in to your Reddit account or use your developer tokenIf you think you've been blocked by mistake, file a ticket below and we'll look into it.Log in File a ticket