Downloads · 30 days
10
2% of all-time downloads
ToluClassics/extractive_reader_nq_squad_v2
extractive_reader_nq_squad_v2 is a question answering model from ToluClassics. Use it when the input is a question plus a passage. It is set up for transformers.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
10
2% of all-time downloads
All-time downloads
509
Public
Repo size
2.1 GB
Likes
0
Public
Click a slice to open those files.
.bin667 MB · 92%
From the Hugging Face model README
This model is a fine-tuned version of ToluClassics/extractive_reader_nq on the squad_v2 dataset.
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
import torch
import numpy as np
from transformers import AutoTokenizer, AutoModelForQuestionAnswering
tokenizer = AutoTokenizer.from_pretrained("ToluClassics/extractive_reader_nq_squad_v2")
model = AutoModelForQuestionAnswering.from_pretrained("ToluClassics/extractive_reader_nq_squad_v2")
question = ""
context = ""
inputs = tokenizer.encode(question, context, add_special_tokens=True, return_tensors="pt")
output = model(inputs)
answer_start = torch.argmax(output.start_logits)
answer_end = torch.argmax(output.end_logits)
if answer_end >= answer_start:
print(tokenizer.decode(inputs[0][answer_start:answer_end+1]))