You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

How to Get Started with the distilbert-base-cased-distilled-finqa

Here is how to use this model in PyTorch:

from transformers import DistilBertTokenizer, DistilBertModel
import torch
tokenizer = DistilBertTokenizer.from_pretrained('distilbert-base-cased-distilled-finqa')
model = DistilBertModel.from_pretrained('distilbert-base-cased-distilled-finqa')

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

print(outputs)

And in TensorFlow:

from transformers import DistilBertTokenizer, TFDistilBertForQuestionAnswering
import tensorflow as tf

tokenizer = DistilBertTokenizer.from_pretrained("distilbert-base-cased-distilled-finqa")
model = TFDistilBertForQuestionAnswering.from_pretrained("distilbert-base-cased-distilled-finqa")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="tf")
outputs = model(**inputs)

answer_start_index = int(tf.math.argmax(outputs.start_logits, axis=-1)[0])
answer_end_index = int(tf.math.argmax(outputs.end_logits, axis=-1)[0])

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
tokenizer.decode(predict_answer_tokens)
Downloads last month
6
Safetensors
Model size
65.2M params
Tensor type
F32
·
Inference API
Unable to determine this model's library. Check the docs .

Datasets used to train tim001/distilbert-base-cased-distilled-finqa

Evaluation results