Downloads · 30 days
2.3K
1% of all-time downloads
MaRiOrOsSi/t5-base-finetuned-question-answering
t5-base-finetuned-question-answering is a machine learning model from MaRiOrOsSi. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
This model is the result produced by Christian Di Maio and Giacomo Nunziati for the Language Processing Technologies exam. Reference for Google's T5 fine-tuned on DuoRC for Generative Question Answering by just prepen…
Downloads · 30 days
2.3K
1% of all-time downloads
All-time downloads
168K
Public
Repo size
2.7 GB
Likes
40
Public
Click a slice to open those files.
.h5892 MB · 50%
From the Hugging Face model README
This model is the result produced by Christian Di Maio and Giacomo Nunziati for the Language Processing Technologies exam. Reference for Google's T5 fine-tuned on DuoRC for Generative Question Answering by just prepending the question to the context.
The code used for T5 training is available at this repository.
The results are evaluated on:
Removing all tokens not related to dictionary words from the evaluation metrics. The model used as reference is BERT finetuned on SQUAD v1.
| Model | SelfRC | ParaphraseRC | SQUAD |
|---|---|---|---|
| T5-BASE-FINETUNED | F1: 49.00 EM: 31.38 | F1: 28.75 EM: 15.18 | F1: 63.28 EM: 37.24 |
| BERT-BASE-FINETUNED | F1: 47.18 EM: 30.76 | F1: 21.20 EM: 12.62 | F1: 77.19 EM: 57.81 |
from transformers import AutoTokenizer, AutoModelWithLMHead, pipeline
model_name = "MaRiOrOsSi/t5-base-finetuned-question-answering"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelWithLMHead.from_pretrained(model_name)
question = "What is 42?"
context = "42 is the answer to life, the universe and everything"
input = f"question: {question} context: {context}"
encoded_input = tokenizer([input],
return_tensors='pt',
max_length=512,
truncation=True)
output = model.generate(input_ids = encoded_input.input_ids,
attention_mask = encoded_input.attention_mask)
output = tokenizer.decode(output[0], skip_special_tokens=True)
print(output)
Created by Christian Di Maio and Giacomo Nunziati
Made with <span style="color: #e25555;">♥</span> in Italy