4️⃣Tabular Qustaion & Answering

Qustaion & Answering

  1. General Q&A

  2. Tabluar Q&A

  3. TEPEX

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

0

Lionel Messi

Paris Saint-Germain

Argentina

25

18

2050

30

2

0

1

Cristiano Ronaldo

Al Nassr

Portugal

30

15

1800

33

3

1

2

Neymar Jr

Paris Saint-Germain

Brazil

18

20

1900

29

4

0

3

Kevin De Bruyne

Manchester City

Belgium

12

25

2300

32

1

0

4

Robert Lewandowski

Barcelona

Poland

34

10

1500

31

5

1

DataFrame to String

Tokenizer & Models

Pipeline

Inference

TAPEX Model

Microsoft에서 개발한 TAPEX 모델은 NLP의 테이블 질문 답변 영역에서 유용합니다.

  • 강력한 성능: TAPEX는 다양한 테이블 질문-답변 벤치마크에서 인상적인 결과를 보여주었으며, 종종 다른 모델을 능가하는 성능을 보였습니다.

  • 다목적성: 자연어 질문과 사실 확인 작업을 모두 처리할 수 있어 광범위한 사용 사례에 적용할 수 있습니다.

  • 접근성: TAPEX는 허깅 페이스 트랜스포머 라이브러리를 통해 제공되므로 다양한 개발자와 연구자가 액세스할 수 있습니다.

Last updated