Create Familytrainer
Browse files123456789101112131415161718192021222324252627282930313233343536pip install transformers datasetsfrom datasets import load_dataset
# Load the datasetdataset = load_dataset("DetectiveShadow/ShadowFamily")
# Inspect the dataset structureprint(dataset)
sample = dataset["train"][0] # Get the first exampleprint(sample)
from transformers import pipeline
# Load the QA pipeline with the modelqa_pipeline = pipeline("question-answering", model="DetectiveShadow/QuestBoard")
# Example: Use the first entry from the datasetquestion = dataset["train"][0]["question"] # Extract questioncontext = dataset["train"][0]["context"] # Extract context
# Get the answer from the modelresult = qa_pipeline(question=question, context=context)
# Print the resultprint(f"Question: {question}")print(f"Answer: {result['answer']}")
for entry in dataset["train"]: question = entry["question"] context = entry["context"]
result = qa_pipeline(question=question, context=context) print(f"Question: {question}") print(f"Answer: {result['answer']}\n")FamilytrainerAdded+36