Downloads · 30 days
42
2% of all-time downloads
zhufy/squad-en-bert-base
squad-en-bert-base is a question answering model from zhufy. Use it when the input is a question plus a passage. It is set up for transformers.
This model is for English extractive question answering. It is based on the bert-base-cased model, and it is case-sensitive: it makes a difference between english and English.
Downloads · 30 days
42
2% of all-time downloads
All-time downloads
2K
Public
Repo size
862 MB
Likes
0
Public
Click a slice to open those files.
.bin431 MB · 100%
From the Hugging Face model README
This model is for English extractive question answering. It is based on the bert-base-cased model, and it is case-sensitive: it makes a difference between english and English.
You can use it directly from the 🤗 Transformers library with a pipeline:
>>> from transformers.pipelines import pipeline
>>> from transformers import AutoTokenizer, AutoModelForQuestionAnswering
>>> tokenizer = AutoTokenizer.from_pretrained("zhufy/squad-en-bert-base")
>>> model = AutoModelForQuestionAnswering.from_pretrained("zhufy/squad-en-bert-base")
>>> nlp = pipeline("question-answering", model=model, tokenizer=tokenizer)
>>> context = "A problem is regarded as inherently difficult if its
solution requires significant resources, whatever the
algorithm used. The theory formalizes this intuition,
by introducing mathematical models of computation to
study these problems and quantifying the amount of
resources needed to solve them, such as time and storage.
Other complexity measures are also used, such as the
amount of communication (used in communication complexity),
the number of gates in a circuit (used in circuit
complexity) and the number of processors (used in parallel
computing). One of the roles of computational complexity
theory is to determine the practical limits on what
computers can and cannot do."
>>> question = "What are two basic primary resources used to
guage complexity?"
>>> inputs = {"question": question,
"context":context }
>>> nlp(inputs)
{'score': 0.8589141368865967,
'start': 305,
'end': 321,
'answer': 'time and storage'}