Overview
BERT-medium SQuAD2 QA (deepset, 41.1M parameters, 164.5MB, 8 layers) scores F1 70.8 and exact match 67.8 on 1,000 SQuAD v2 dev questions in our measurement: F1 71.5 on answerable questions, and it correctly declines 70.0 percent of the unanswerable ones. The best simple baseline scores F1 50.4.
Model details
BERT-medium SQuAD2 QA is a 8-layer English extractive question-answering model published by deepset on Hugging Face: 41.1M parameters (8 layers, 8 attention heads, hidden size 512, 30,522-token vocabulary), 164.5MB of weights, licensed MIT.
Measured quality
SQuAD v2 dev, official metrics, 1,000 seeded questions (50 percent unanswerable): exact match 67.8, F1 70.8. This is Wikipedia text; evaluate on your own documents before relying on it.
Request and response
Request: {"inputs": [{"question": "Where was Marie Curie born?", "context": "Marie Curie was born in Warsaw in 1867. She later moved to Paris, where she studied physics."}]} Response: {"answers": [{"answer": "Warsaw", "score": 0.986788, "start": 24, "end": 30, "no_answer": false}]} Give it a question and a passage and it returns the span that answers it, with character offsets and a confidence score, or reports that the passage does not answer; the weights run on ml.t2.medium, the smallest SageMaker real-time instance type. Up to 32 question/context pairs per request. allow_no_answer (default true) lets the model decline; max_answer_len (default 30 tokens) caps the span. answer is exactly context[start:end].
Pricing
Software fee: $0.05 per instance-hour, billed by AWS Marketplace on top of the SageMaker instance. Real-time on ml.t2.medium: $0.05 + $0.056 = about $0.106 per hour (us-east-1). Batch transform on ml.m5.large: $0.05 + $0.115 = about $0.165 per hour, billed only while the job runs. Delete the endpoint when you finish to stop charges. Burstable t2 instances suit evaluation and light traffic; measure throughput before sustained heavy use.
Limits
English text. Contexts longer than the model window are read in overlapping windows. The model extracts text that is already in your passage; it does not write new answers. A question about a different entity than the passage mentions can still receive the passage's value (measured: about 5 percent are declined), so check answers against the source.
Deploy in 5 steps
Prerequisites: an AWS account, a SageMaker execution role, and boto3 with SageMaker permissions. No GPU and no VPC setup are needed.
- Subscribe to this listing and copy the model package ARN from the subscription.
- Create a model from that ARN with network isolation on.
- Create an endpoint on ml.t2.medium.
- Send the sample request below.
- Delete the endpoint, endpoint config and model when you are done. Time to value (estimate): typically under 10 minutes from subscription to first response, most of it SageMaker creating the endpoint. Sample code (the same calls we used to verify this package on a real endpoint): import boto3, json sm = boto3.client("sagemaker"); rt = boto3.client("sagemaker-runtime") arn = ""; role = "" sm.create_model(ModelName="m", ExecutionRoleArn=role, PrimaryContainer={"ModelPackageName": arn}, EnableNetworkIsolation=True) sm.create_endpoint_config(EndpointConfigName="m", ProductionVariants=[{"VariantName": "v", "ModelName": "m", "InstanceType": "ml.t2.medium", "InitialInstanceCount": 1}]) sm.create_endpoint(EndpointName="m", EndpointConfigName="m") sm.get_waiter("endpoint_in_service").wait(EndpointName="m") r = rt.invoke_endpoint(EndpointName="m", ContentType="application/json", Body=json.dumps({'inputs': [{'question': 'Where was Marie Curie born?', 'context': 'Marie Curie was born in Warsaw in 1867. She later moved to Paris, where she studied physics.'}]})) print(r["Body"].read().decode()) sm.delete_endpoint(EndpointName="m"); sm.delete_endpoint_config(EndpointConfigName="m"); sm.delete_model(ModelName="m")
Support
Email support@waltsoft.net . We reply within 1 business day (Monday to Friday). Covered: help deploying this model package on SageMaker, request and response format questions, and fixes for defects in the packaged container. Not covered: accuracy tuning on your own data, your application code, AWS account, IAM or quota issues, and custom model changes.
FAQ
Is my data sent anywhere? No. The model runs inside your SageMaker endpoint and the package is network-isolated. Which model is this? deepset/bert-medium-squad2-distilled, licensed MIT. How do I deploy it? Subscribe, then create a real-time endpoint or batch transform job from the model package.
Highlights
- 164.5MB, 41.1M-parameter extractive QA model that runs on ml.t2.medium, the smallest SageMaker real-time instance type
- Measured SQuAD v2 F1 70.8 against 50.4 for the best simple baseline on 1,000 questions
- Returns the answer span with character offsets and a score, or declines when the passage does not answer, for up to 32 pairs per request
Details
Features and programs
Financing for AWS Marketplace purchases
Pricing
Dimension | Description | Cost/host/hour |
|---|---|---|
ml.t2.medium Inference (Real-Time) Recommended | Model inference on the ml.t2.medium instance type, real-time mode | $0.05 |
ml.m5.large Inference (Batch) Recommended | Model inference on the ml.m5.large instance type, batch mode | $0.05 |
Vendor refund policy
No refunds.
How can we make this page better?
Legal
Vendor terms and conditions
Content disclaimer
Delivery details
Amazon SageMaker model
An Amazon SageMaker model package is a pre-trained machine learning model ready to use without additional training. Use the model package to create a model on Amazon SageMaker for real-time inference or batch processing. Amazon SageMaker is a fully managed platform for building, training, and deploying machine learning models at scale.
Version release notes
Initial release
Additional details
Inputs
- Summary
Extractive question answering from deepset: 41.1M parameters, 164.5MB, answers from your text with character offsets or says there is no answer. SQuAD v2 F1 70.8 (best simple baseline 50.4). MIT, runs on ml.t2.medium.
- Input MIME type
- application/json
Support
Vendor support
Email support@waltsoft.net . Reply within 1 business day (Monday to Friday). Covers deployment help, request and response format questions and fixes for defects in the packaged container. Does not cover accuracy tuning on your data, your application code, AWS account, IAM or quota issues, or custom model changes.
AWS infrastructure support
AWS Support is a one-on-one, fast-response support channel that is staffed 24x7x365 with experienced and technical support engineers. The service helps customers of all sizes and technical abilities to successfully utilize the products and features provided by Amazon Web Services.