|
--- |
|
language: es |
|
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.\u200b 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 QA 📖❓ |
|
[Google's mT5-small](https://huggingface.co./flax-community/spanish-t5-small) fine-tuned on [SQAC](https://huggingface.co./datasets/BSC-TeMU/SQAC) (secondary task) for **Q&A** downstream task. |
|
|
|
## Details of Spanish T5 (small) |
|
|
|
|
|
|
|
|
|
## Details of the dataset 📚 |
|
|
|
|
|
|
|
|
|
|
|
## Results on test dataset 📝 |
|
|
|
| Metric | # Value | |
|
| ------ | --------- | |
|
| **EM** | **41.65** | |
|
|
|
|
|
|
|
## Model in Action 🚀 |
|
|
|
```python |
|
from transformers import AutoModelForCausalLM, AutoTokenizer |
|
import torch |
|
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') |
|
tokenizer = AutoTokenizer.from_pretrained("mrm8488/mT5-small-finetuned-tydiqa-for-xqa") |
|
model = AutoModelForCausalLM.from_pretrained("mrm8488/mT5-small-finetuned-tydiqa-for-xqa").to(device) |
|
|
|
def get_response(question, context, max_length=32): |
|
input_text = 'question: %s context: %s' % (question, context) |
|
features = tokenizer([input_text], return_tensors='pt') |
|
|
|
output = model.generate(input_ids=features['input_ids'].to(device), |
|
attention_mask=features['attention_mask'].to(device), |
|
max_length=max_length) |
|
|
|
return tokenizer.decode(output[0], skip_special_tokens=True) |
|
|
|
# Some examples in different languages |
|
|
|
context = 'HuggingFace won the best Demo paper at EMNLP2020.' |
|
question = 'What won HuggingFace?' |
|
get_response(question, context) |
|
|
|
context = 'HuggingFace ganó la mejor demostración con su paper en la EMNLP2020.' |
|
question = 'Qué ganó HuggingFace?' |
|
get_response(question, context) |
|
|
|
context = 'HuggingFace выиграл лучшую демонстрационную работу на EMNLP2020.' |
|
question = 'Что победило в HuggingFace?' |
|
get_response(question, context) |
|
``` |
|
|
|
> Created by [Manuel Romero/@mrm8488](https://twitter.com/mrm8488) | [LinkedIn](https://www.linkedin.com/in/manuel-romero-cs/) |
|
|
|
> Made with <span style="color: #e25555;">♥</span> in Spain |
|
|