Views
No views yet
transformers library. Here’s a Python code example:1from transformers import pipeline
2
3model_checkpoint = "Ashaduzzaman/bert-finetuned-squad"
4question_answerer = pipeline("question-answering", model=model_checkpoint)
5
6question = "What is the name of the architectures?"
7context = """
8🤗 Transformers (formerly known as pytorch-transformers and pytorch-pretrained-
9and pytorch-nlp) provides general-purpose architectures (BERT, GPT-2, RoBERTa, XLM, DistilBert, XLNet…) for Natural
10Language Understanding (NLU) and Natural Language Generation (NLG) with over 32+ pretrained models in 100+ languages and
11with state-of-the-art performance on SQuAD, GLUE, AWS Glue, and other benchmarks.
12"""
13
14result = question_answerer(question=question, context=context)
15print(result['answer'])transformers library with the following hyperparameters:betas=(0.9,0.999) and epsilon=1e-08