Downloads · 30 days
32
7% of all-time downloads
prabinpanta0/ZenGQ
ZenGQ is a question answering model from prabinpanta0. Use it when the input is a question plus a passage. It is set up for transformers. The card lists the license as mit.
This is a fine-tuned BERT model for question answering tasks, trained on a custom dataset.
Downloads · 30 days
32
7% of all-time downloads
All-time downloads
453
Public
Parameters
109M
491 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors436 MB · 88%
From the Hugging Face model README
This is a fine-tuned BERT model for question answering tasks, trained on a custom dataset.
from transformers import AutoTokenizer, AutoModelForQuestionAnswering, pipeline
# Load the tokenizer and model from Hugging Face
tokenizer = AutoTokenizer.from_pretrained("prabinpanta0/ZenGQ")
model = AutoModelForQuestionAnswering.from_pretrained("prabinpanta0/ZenGQ")
# Create a pipeline for question answering
qa_pipeline = pipeline("question-answering", model=model, tokenizer=tokenizer)
# Define your context and questions
contexts = ["Berlin is the capital of Germany.",
"Paris is the capital of France.",
"Madrid is the capital of Spain."]
questions = [
"What is the capital of Germany?",
"Which city is the capital of France?",
"What is the capital of Spain?"
]
# Get answers
for context, question in zip(contexts, questions):
result = qa_pipeline(question=question, context=context)
print(f"Question: {question}")
print(f"Answer: {result['answer']}\n")
text = "Berlin is the capital of Germany. Paris is the capital of France. Madrid is the capital of Spain."
tokens = tokenizer.tokenize(text)
print(tokens)
Output:
['berlin', 'is', 'the', 'capital', 'of', 'germany', '.', 'paris', 'is', 'the', 'capital', 'of', 'france', '.', 'madrid', 'is', 'the', 'capital', 'of', 'spain', '.']
The model was trained on the Rep00Zon dataset.
This model is licensed under the MIT License.