Feature Extraction
Transformers
Safetensors
English
distilbert
question-answering
extractive-qa
squad
text-embeddings-inference
Instructions to use harpertoken/quiz with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use harpertoken/quiz with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="harpertoken/quiz")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForQuestionAnswering tokenizer = AutoTokenizer.from_pretrained("harpertoken/quiz") model = AutoModelForQuestionAnswering.from_pretrained("harpertoken/quiz", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Delete files quiz.md quiz_upload.md with huggingface_hub
Browse files- quiz.md +0 -53
- quiz_upload.md +0 -53
quiz.md
DELETED
|
@@ -1,53 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
language: en
|
| 4 |
-
library_name: transformers
|
| 5 |
-
pipeline_tag: feature-extraction
|
| 6 |
-
base_model: distilbert-base-uncased
|
| 7 |
-
datasets:
|
| 8 |
-
- squad
|
| 9 |
-
tags:
|
| 10 |
-
- distilbert
|
| 11 |
-
- extractive-qa
|
| 12 |
-
- question-answering
|
| 13 |
-
- squad
|
| 14 |
-
---
|
| 15 |
-
|
| 16 |
-
# quiz
|
| 17 |
-
|
| 18 |
-
A DistilBERT encoder fine-tuned for extractive question answering on SQuAD. Given a question and a passage, the model returns the span of text it identifies as the answer. It does not generate replies, and there is no conversation, retrieval or fallback logic anywhere in the repository — the weights are a single extractive span predictor.
|
| 19 |
-
|
| 20 |
-
The encoder is `distilbert-base-uncased`: six layers, 768 hidden dimensions, roughly 66M parameters, with a span-prediction head, stored in float32. Because the vocabulary is uncased WordPiece, input is lowercased and the model cannot distinguish `Apple` from `apple`. The 512-token position limit comes from DistilBERT and bounds the combined length of question and passage.
|
| 21 |
-
|
| 22 |
-
## Usage
|
| 23 |
-
|
| 24 |
-
Transformers 5 removed the `question-answering` pipeline, so load the model directly:
|
| 25 |
-
|
| 26 |
-
```python
|
| 27 |
-
import torch
|
| 28 |
-
from transformers import AutoModelForQuestionAnswering, AutoTokenizer
|
| 29 |
-
|
| 30 |
-
tok = AutoTokenizer.from_pretrained("harpertoken/quiz")
|
| 31 |
-
model = AutoModelForQuestionAnswering.from_pretrained("harpertoken/quiz")
|
| 32 |
-
|
| 33 |
-
question = "Who wrote Hamlet?"
|
| 34 |
-
context = "Hamlet is a tragedy written by William Shakespeare around 1600."
|
| 35 |
-
inputs = tok(question, context, return_tensors="pt", truncation=True, max_length=512)
|
| 36 |
-
|
| 37 |
-
with torch.inference_mode():
|
| 38 |
-
out = model(**inputs)
|
| 39 |
-
start, end = int(out.start_logits.argmax()), int(out.end_logits.argmax())
|
| 40 |
-
print(tok.decode(inputs.input_ids[0][start : end + 1]))
|
| 41 |
-
```
|
| 42 |
-
|
| 43 |
-
On three check questions the model returns `paris`, `william shakespeare` and `1889`. Answers come back lowercased, since the input was.
|
| 44 |
-
|
| 45 |
-
The repository now ships only `model.safetensors`; an earlier version also carried the same parameters as `pytorch_model.bin`, which doubled the download for no benefit.
|
| 46 |
-
|
| 47 |
-
## Limitations
|
| 48 |
-
|
| 49 |
-
SQuAD is a reading-comprehension benchmark assembled from English Wikipedia paragraphs, and a model trained on it inherits that distribution. Performance on specialised domains, on questions requiring multi-hop reasoning, and on passages substantially longer than a Wikipedia paragraph will be lower than the in-domain numbers suggest, and I have not measured them here. Earlier versions of this card quoted exact-match and F1 scores and described TensorFlow support and multi-strategy response generation. The scores came from no evaluation I can point to, and no TensorFlow checkpoint was ever present, so both have been removed. If you need a number, evaluate on your own data with the SQuAD v1.1 dev set as a reference point.
|
| 50 |
-
|
| 51 |
-
## Attribution
|
| 52 |
-
|
| 53 |
-
DistilBERT is described in Sanh et al., *DistilBERT, a distilled version of BERT* (2019). SQuAD is described in Rajpurkar et al., *SQuAD: 100,000+ Questions for Machine Comprehension of Text* (2016).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
quiz_upload.md
DELETED
|
@@ -1,53 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
language: en
|
| 4 |
-
library_name: transformers
|
| 5 |
-
pipeline_tag: feature-extraction
|
| 6 |
-
base_model: distilbert-base-uncased
|
| 7 |
-
datasets:
|
| 8 |
-
- squad
|
| 9 |
-
tags:
|
| 10 |
-
- distilbert
|
| 11 |
-
- extractive-qa
|
| 12 |
-
- question-answering
|
| 13 |
-
- squad
|
| 14 |
-
---
|
| 15 |
-
|
| 16 |
-
# quiz
|
| 17 |
-
|
| 18 |
-
A DistilBERT encoder fine-tuned for extractive question answering on SQuAD. Given a question and a passage, the model returns the span of text it identifies as the answer. It does not generate replies, and there is no conversation, retrieval or fallback logic anywhere in the repository — the weights are a single extractive span predictor.
|
| 19 |
-
|
| 20 |
-
The encoder is `distilbert-base-uncased`: six layers, 768 hidden dimensions, roughly 66M parameters, with a span-prediction head, stored in float32. Because the vocabulary is uncased WordPiece, input is lowercased and the model cannot distinguish `Apple` from `apple`. The 512-token position limit comes from DistilBERT and bounds the combined length of question and passage.
|
| 21 |
-
|
| 22 |
-
## Usage
|
| 23 |
-
|
| 24 |
-
Transformers 5 removed the `question-answering` pipeline, so load the model directly:
|
| 25 |
-
|
| 26 |
-
```python
|
| 27 |
-
import torch
|
| 28 |
-
from transformers import AutoModelForQuestionAnswering, AutoTokenizer
|
| 29 |
-
|
| 30 |
-
tok = AutoTokenizer.from_pretrained("harpertoken/quiz")
|
| 31 |
-
model = AutoModelForQuestionAnswering.from_pretrained("harpertoken/quiz")
|
| 32 |
-
|
| 33 |
-
question = "Who wrote Hamlet?"
|
| 34 |
-
context = "Hamlet is a tragedy written by William Shakespeare around 1600."
|
| 35 |
-
inputs = tok(question, context, return_tensors="pt", truncation=True, max_length=512)
|
| 36 |
-
|
| 37 |
-
with torch.inference_mode():
|
| 38 |
-
out = model(**inputs)
|
| 39 |
-
start, end = int(out.start_logits.argmax()), int(out.end_logits.argmax())
|
| 40 |
-
print(tok.decode(inputs.input_ids[0][start : end + 1]))
|
| 41 |
-
```
|
| 42 |
-
|
| 43 |
-
On three check questions the model returns `paris`, `william shakespeare` and `1889`. Answers come back lowercased, since the input was.
|
| 44 |
-
|
| 45 |
-
The repository now ships only `model.safetensors`; an earlier version also carried the same parameters as `pytorch_model.bin`, which doubled the download for no benefit.
|
| 46 |
-
|
| 47 |
-
## Limitations
|
| 48 |
-
|
| 49 |
-
SQuAD is a reading-comprehension benchmark assembled from English Wikipedia paragraphs, and a model trained on it inherits that distribution. Performance on specialised domains, on questions requiring multi-hop reasoning, and on passages substantially longer than a Wikipedia paragraph will be lower than the in-domain numbers suggest, and I have not measured them here. Earlier versions of this card quoted exact-match and F1 scores and described TensorFlow support and multi-strategy response generation. The scores came from no evaluation I can point to, and no TensorFlow checkpoint was ever present, so both have been removed. If you need a number, evaluate on your own data with the SQuAD v1.1 dev set as a reference point.
|
| 50 |
-
|
| 51 |
-
## Attribution
|
| 52 |
-
|
| 53 |
-
DistilBERT is described in Sanh et al., *DistilBERT, a distilled version of BERT* (2019). SQuAD is described in Rajpurkar et al., *SQuAD: 100,000+ Questions for Machine Comprehension of Text* (2016).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|