mrm8488's picture
Update README.md
61e89a3
|
raw
history blame
3.21 kB
metadata
language: es
tags:
  - QA
  - Q&A
datasets:
  - BSC-TeMU/SQAC
widget:
  - text: >-
      question: ¿Cuál es el nombre que se le da a la unidad morfológica y
      funcional de los seres vivos? context: La célula (del latín cellula,
      diminutivo de cella, ‘celda’) es la unidad morfológica y funcional de todo
      ser vivo. De hecho, la célula es el elemento de menor tamaño que puede
      considerarse vivo.​ De este modo, puede clasificarse a los organismos
      vivos según el número de células que posean: si solo tienen una, se les
      denomina unicelulares (como pueden ser los protozoos o las bacterias,
      organismos microscópicos); si poseen más, se les llama pluricelulares. En
      estos últimos el número de células es variable: de unos pocos cientos,
      como en algunos nematodos, a cientos de billones (1014), como en el caso
      del ser humano. Las células suelen poseer un tamaño de 10 µm y una masa de
      1 ng, si bien existen células mucho mayores.

Spanish T5 (small) fine-tuned on SQAC for Spanish QA 📖❓

spanish-T5-small fine-tuned on SQAC for Q&A downstream task.

Details of Spanish T5 (small)

T5 (small) like arch trained from scatch on large_spanish_corpus for HuggingFace/Flax/Jax Week.

Details of the dataset 📚

This dataset contains 6,247 contexts and 18,817 questions with their answers, 1 to 5 for each fragment. The sources of the contexts are:

Results on test dataset 📝

Metric # Value
BLEU 41.94

Model in Action 🚀

from transformers import T5ForConditionalGeneration, AutoTokenizer
import torch
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
ckpt = 'mrm8488/spanish-t5-small-sqac-for-qa'
tokenizer = AutoTokenizer.from_pretrained(ckpt)
model = T5ForConditionalGeneration.from_pretrained(ckpt).to(device)



def get_answer(question, context):
  input_text = 'question: %s  context: %s' % (question, context)
  features = tokenizer([input_text ], padding='max_length', truncation=True, max_length=512, return_tensors='pt')
  output = model.generate(input_ids=features['input_ids'].to(device), 
               attention_mask=features['attention_mask'].to(device))

  return tokenizer.decode(output[0], skip_special_tokens=True)
  

Created by Manuel Romero/@mrm8488 | LinkedIn

Made with in Spain