Instructions to use mcsabai/huBert-fine-tuned-hungarian-squadv1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mcsabai/huBert-fine-tuned-hungarian-squadv1 with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "question-answering" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("question-answering", model="mcsabai/huBert-fine-tuned-hungarian-squadv1")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForQuestionAnswering tokenizer = AutoTokenizer.from_pretrained("mcsabai/huBert-fine-tuned-hungarian-squadv1") model = AutoModelForQuestionAnswering.from_pretrained("mcsabai/huBert-fine-tuned-hungarian-squadv1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
MODEL DESCRIPTION
huBERT base model (cased) fine-tuned on SQuAD v1
- huBert model + Tokenizer: https://huggingface.co/SZTAKI-HLT/hubert-base-cc
- Hungarian SQUAD v1 dataset: Machine Translated SQuAD dataset (Google Translate API)
- This is a demo model. Date of publication: 2022.03.27.
Model in action
- Fast usage with pipelines:
from transformers import pipeline
qa_pipeline = pipeline(
"question-answering",
model="mcsabai/huBert-fine-tuned-hungarian-squadv1",
tokenizer="mcsabai/huBert-fine-tuned-hungarian-squadv1"
)
predictions = qa_pipeline({
'context': "Anita vagyok és Budapesten élek már több mint 4 éve.",
'question': "Hol lakik Anita?"
})
print(predictions)
# output:
# {'score': 0.9892364144325256, 'start': 16, 'end': 26, 'answer': 'Budapesten'}
- Downloads last month
- 33