from transformers import pipeline
qa = pipeline("question-answering", model="distilbert-base-uncased-distilled-squad")
context = "Marie Curie was a physicist and chemist who conducted pioneering research on radioactivity. She was the first woman to win a Nobel Prize and remains the only person to win Nobel Prizes in two different scientific fields."
question = "What did Marie Curie win Nobel Prizes for?"
result = qa(question=question, context=context)
print(result)
{'score': 0.48542842268943787, 'start': 188, 'end': 219, 'answer': 'two different scientific fields'}
Full text:
https://chatgpt.com/share/687edd09-9500 ... e0bd9b3672
COMMENT:
Technically, we got this example program run. But what do you think "What did Marie Curie win Nobel Prizes for"?
Dehype LLM and Get Things Done
此博文来自论坛版块:葵花宝典(Programming)