Update README.md
Browse files
README.md
CHANGED
@@ -52,7 +52,7 @@ from transformers import pipeline
|
|
52 |
question = "What would to the carmine pigment if not used diligently?"
|
53 |
context = "The painters of the early Renaissance used two traditional lake pigments, made from mixing dye with either chalk or alum, kermes lake, made from kermes insects, and madder lake, made from the rubia tinctorum plant. With the arrival of cochineal, they had a third, carmine, which made a very fine crimson, though it had a tendency to change color if not used carefully. It was used by almost all the great painters of the 15th and 16th centuries, including Rembrandt, Vermeer, Rubens, Anthony van Dyck, Diego Vel\u00e1zquez and Tintoretto. Later it was used by Thomas Gainsborough, Seurat and J.M.W. Turner."
|
54 |
|
55 |
-
question_answerer = pipeline("question-answering", model="Falconsai/
|
56 |
question_answerer(question=question, context=context)
|
57 |
|
58 |
|
@@ -68,10 +68,10 @@ from transformers import AutoModelForQuestionAnswering
|
|
68 |
question = "On which date did Swansea City play its first Premier League game?"
|
69 |
context = "In 2011, a Welsh club participated in the Premier League for the first time after Swansea City gained promotion. The first Premier League match to be played outside England was Swansea City's home match at the Liberty Stadium against Wigan Athletic on 20 August 2011. In 2012\u201313, Swansea qualified for the Europa League by winning the League Cup. The number of Welsh clubs in the Premier League increased to two for the first time in 2013\u201314, as Cardiff City gained promotion, but Cardiff City was relegated after its maiden season."
|
70 |
|
71 |
-
tokenizer = AutoTokenizer.from_pretrained("Falconsai/
|
72 |
inputs = tokenizer(question, context, return_tensors="pt")
|
73 |
|
74 |
-
model = AutoModelForQuestionAnswering.from_pretrained("Falconsai/
|
75 |
with torch.no_grad():
|
76 |
outputs = model(**inputs)
|
77 |
|
|
|
52 |
question = "What would to the carmine pigment if not used diligently?"
|
53 |
context = "The painters of the early Renaissance used two traditional lake pigments, made from mixing dye with either chalk or alum, kermes lake, made from kermes insects, and madder lake, made from the rubia tinctorum plant. With the arrival of cochineal, they had a third, carmine, which made a very fine crimson, though it had a tendency to change color if not used carefully. It was used by almost all the great painters of the 15th and 16th centuries, including Rembrandt, Vermeer, Rubens, Anthony van Dyck, Diego Vel\u00e1zquez and Tintoretto. Later it was used by Thomas Gainsborough, Seurat and J.M.W. Turner."
|
54 |
|
55 |
+
question_answerer = pipeline("question-answering", model="Falconsai/question_answering_v2")
|
56 |
question_answerer(question=question, context=context)
|
57 |
|
58 |
|
|
|
68 |
question = "On which date did Swansea City play its first Premier League game?"
|
69 |
context = "In 2011, a Welsh club participated in the Premier League for the first time after Swansea City gained promotion. The first Premier League match to be played outside England was Swansea City's home match at the Liberty Stadium against Wigan Athletic on 20 August 2011. In 2012\u201313, Swansea qualified for the Europa League by winning the League Cup. The number of Welsh clubs in the Premier League increased to two for the first time in 2013\u201314, as Cardiff City gained promotion, but Cardiff City was relegated after its maiden season."
|
70 |
|
71 |
+
tokenizer = AutoTokenizer.from_pretrained("Falconsai/question_answering_v2")
|
72 |
inputs = tokenizer(question, context, return_tensors="pt")
|
73 |
|
74 |
+
model = AutoModelForQuestionAnswering.from_pretrained("Falconsai/question_answering_v2")
|
75 |
with torch.no_grad():
|
76 |
outputs = model(**inputs)
|
77 |
|