4️⃣Tabular Qustaion & Answering
Qustaion & Answering
General Q&A
from transformers import pipeline
qa_model = pipeline(
"question-answering",
"timpal0l/mdeberta-v3-base-squad2"
)
context = "The Great Wall of China is one of the world's most famous landmarks. It was built over several centuries and is thousands of kilometers long. The wall was primarily constructed to protect against invasions and raids from various nomadic groups from the Eurasian Steppe."
question = "What was the primary purpose of building the Great Wall of China?"
qa_model(question = question, context = context)/home/kubwa/anaconda3/envs/pytorch/lib/python3.11/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
from .autonotebook import tqdm as notebook_tqdm
config.json: 100%|██████████| 879/879 [00:00<00:00, 2.19MB/s]
model.safetensors: 100%|██████████| 1.11G/1.11G [00:57<00:00, 19.4MB/s]
tokenizer_config.json: 100%|██████████| 453/453 [00:00<00:00, 1.21MB/s]
tokenizer.json: 100%|██████████| 16.3M/16.3M [00:02<00:00, 7.32MB/s]
added_tokens.json: 100%|██████████| 23.0/23.0 [00:00<00:00, 46.9kB/s]
special_tokens_map.json: 100%|██████████| 173/173 [00:00<00:00, 458kB/s]
{'score': 0.31094032526016235,
'start': 176,
'end': 215,
'answer': ' to protect against invasions and raids'}Tabluar Q&A
Pandas DataFrame
Player Name
Team
Nationality
Goals
Assists
Passes Completed
Matches Played
Yellow Cards
Red Cards
DataFrame to String
Tokenizer & Models
Pipeline
Inference
TAPEX Model
Last updated