Multitabqa Base
MultiTabQAは複数の入力テーブルから回答テーブルを生成できるテーブルQAモデルで、UNION、INTERSECT、EXCEPT、JOINSなどのマルチテーブル操作をサポートします。
ダウンロード数 185
リリース時間 : 7/5/2023
モデル概要
MultiTabQAはTAPEX(BART)アーキテクチャを基にしており、双方向エンコーダーと自己回帰デコーダーを備え、複数のテーブルに関連する自然言語質問の処理に特化しています。
モデル特徴
マルチテーブル操作サポート
UNION、INTERSECT、EXCEPT、JOINSなど、複数のテーブルにまたがる複雑な操作を処理可能
テーブル生成機能
質問に答えるだけでなく、構造化されたテーブルを回答として出力可能
TAPEXアーキテクチャ採用
TAPEX(BART)アーキテクチャを採用し、双方向エンコーディングと自己回帰デコーディングの利点を組み合わせている
モデル能力
マルチテーブルQA
テーブル生成
SQLクエリ実行
使用事例
データベースクエリ
クロステーブル統計クエリ
'言及されていない責任者が率いる部署はいくつあるか?'など、複数テーブルにまたがる統計質問に回答
統計結果を含むテーブルを生成
複雑な関係クエリ
複数のテーブル関係を含む複雑なクエリを処理
テーブル関係を反映したクエリ結果を生成
🚀 MultiTabQA (ベースサイズのモデル)
MultiTabQAは、Vaishali Pal、Andrew Yates、Evangelos Kanoulas、Maarten de RijkeによるMultiTabQA: Generating Tabular Answers for Multi-Table Question Answeringで提案されたモデルです。元のリポジトリはこちらで見つけることができます。
✨ 主な機能
モデルの説明
MultiTabQAは、複数の入力テーブルから回答テーブルを生成するtableQAモデルです。UNION、INTERSECT、EXCEPT、JOINSなどの多テーブル演算子を扱うことができます。
MultiTabQAはTAPEX(BART)アーキテクチャに基づいており、双方向(BERTのような)エンコーダと自己回帰(GPTのような)デコーダを持っています。
想定される用途
生モデルを使用して、複数の入力テーブルに対するSQL実行を行うことができます。このモデルはSpiderデータセットでファインチューニングされており、複数の入力テーブルに対する自然言語の質問に回答することができます。
📦 インストール
このセクションではインストールに関する具体的な手順が提供されていないため、スキップします。
💻 使用例
基本的な使用法
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
import pandas as pd
tokenizer = AutoTokenizer.from_pretrained("vaishali/multitabqa-base")
model = AutoModelForSeq2SeqLM.from_pretrained("vaishali/multitabqa-base")
question = "How many departments are led by heads who are not mentioned?"
table_names = ['department', 'management']
tables=[{"columns":["Department_ID","Name","Creation","Ranking","Budget_in_Billions","Num_Employees"],
"index":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],
"data":[
[1,"State","1789",1,9.96,30266.0],
[2,"Treasury","1789",2,11.1,115897.0],
[3,"Defense","1947",3,439.3,3000000.0],
[4,"Justice","1870",4,23.4,112557.0],
[5,"Interior","1849",5,10.7,71436.0],
[6,"Agriculture","1889",6,77.6,109832.0],
[7,"Commerce","1903",7,6.2,36000.0],
[8,"Labor","1913",8,59.7,17347.0],
[9,"Health and Human Services","1953",9,543.2,67000.0],
[10,"Housing and Urban Development","1965",10,46.2,10600.0],
[11,"Transportation","1966",11,58.0,58622.0],
[12,"Energy","1977",12,21.5,116100.0],
[13,"Education","1979",13,62.8,4487.0],
[14,"Veterans Affairs","1989",14,73.2,235000.0],
[15,"Homeland Security","2002",15,44.6,208000.0]
]
},
{"columns":["department_ID","head_ID","temporary_acting"],
"index":[0,1,2,3,4],
"data":[
[2,5,"Yes"],
[15,4,"Yes"],
[2,6,"Yes"],
[7,3,"No"],
[11,10,"No"]
]
}]
input_tables = [pd.read_json(table, orient="split") for table in tables]
# flatten the model inputs in the format: query + " " + <table_name> : table_name1 + flattened_table1 + <table_name> : table_name2 + flattened_table2 + ...
#flattened_input = question + " " + [f"<table_name> : {table_name} linearize_table(table) for table_name, table in zip(table_names, tables)]
model_input_string = """How many departments are led by heads who are not mentioned? <table_name> : department col : Department_ID | Name | Creation | Ranking | Budget_in_Billions | Num_Employees row 1 : 1 | State | 1789 | 1 | 9.96 | 30266 row 2 : 2 | Treasury | 1789 | 2 | 11.1 | 115897 row 3 : 3 | Defense | 1947 | 3 | 439.3 | 3000000 row 4 : 4 | Justice | 1870 | 4 | 23.4 | 112557 row 5 : 5 | Interior | 1849 | 5 | 10.7 | 71436 row 6 : 6 | Agriculture | 1889 | 6 | 77.6 | 109832 row 7 : 7 | Commerce | 1903 | 7 | 6.2 | 36000 row 8 : 8 | Labor | 1913 | 8 | 59.7 | 17347 row 9 : 9 | Health and Human Services | 1953 | 9 | 543.2 | 67000 row 10 : 10 | Housing and Urban Development | 1965 | 10 | 46.2 | 10600 row 11 : 11 | Transportation | 1966 | 11 | 58.0 | 58622 row 12 : 12 | Energy | 1977 | 12 | 21.5 | 116100 row 13 : 13 | Education | 1979 | 13 | 62.8 | 4487 row 14 : 14 | Veterans Affairs | 1989 | 14 | 73.2 | 235000 row 15 : 15 | Homeland Security | 2002 | 15 | 44.6 | 208000 <table_name> : management col : department_ID | head_ID | temporary_acting row 1 : 2 | 5 | Yes row 2 : 15 | 4 | Yes row 3 : 2 | 6 | Yes row 4 : 7 | 3 | No row 5 : 11 | 10 | No"""
inputs = tokenizer(model_input_string, return_tensors="pt")
outputs = model.generate(**inputs)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
# 'col : count(*) row 1 : 11'
高度な使用法
このセクションで高度な使用法に関する具体的なコードや説明が提供されていないため、スキップします。
ファインチューニングの方法
ファインチューニングのスクリプトはこちらで見つけることができます。
📚 ドキュメント
BibTeXエントリと引用情報
@inproceedings{pal-etal-2023-multitabqa,
title = "{M}ulti{T}ab{QA}: Generating Tabular Answers for Multi-Table Question Answering",
author = "Pal, Vaishali and
Yates, Andrew and
Kanoulas, Evangelos and
de Rijke, Maarten",
booktitle = "Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
month = jul,
year = "2023",
address = "Toronto, Canada",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2023.acl-long.348",
doi = "10.18653/v1/2023.acl-long.348",
pages = "6322--6334",
abstract = "Recent advances in tabular question answering (QA) with large language models are constrained in their coverage and only answer questions over a single table. However, real-world queries are complex in nature, often over multiple tables in a relational database or web page. Single table questions do not involve common table operations such as set operations, Cartesian products (joins), or nested queries. Furthermore, multi-table operations often result in a tabular output, which necessitates table generation capabilities of tabular QA models. To fill this gap, we propose a new task of answering questions over multiple tables. Our model, MultiTabQA, not only answers questions over multiple tables, but also generalizes to generate tabular answers. To enable effective training, we build a pre-training dataset comprising of 132,645 SQL queries and tabular answers. Further, we evaluate the generated tables by introducing table-specific metrics of varying strictness assessing various levels of granularity of the table structure. MultiTabQA outperforms state-of-the-art single table QA models adapted to a multi-table QA setting by finetuning on three datasets: Spider, Atis and GeoQuery.",
}
📄 ライセンス
このプロジェクトはMITライセンスの下で公開されています。
Distilbert Base Cased Distilled Squad
Apache-2.0
DistilBERTはBERTの軽量蒸留バージョンで、パラメータ数が40%減少し、速度が60%向上し、95%以上の性能を維持しています。このモデルはSQuAD v1.1データセットで微調整された質問応答専用バージョンです。
質問応答システム 英語
D
distilbert
220.76k
244
Distilbert Base Uncased Distilled Squad
Apache-2.0
DistilBERTはBERTの軽量蒸留バージョンで、パラメータ数が40%減少し、速度が60%向上し、GLUEベンチマークテストでBERTの95%以上の性能を維持します。このモデルは質問応答タスク用に微調整されています。
質問応答システム
Transformers 英語

D
distilbert
154.39k
115
Tapas Large Finetuned Wtq
Apache-2.0
TAPASはBERTアーキテクチャに基づく表質問応答モデルで、ウィキペディアの表データで自己監督方式により事前学習され、表内容に対する自然言語質問応答をサポート
質問応答システム
Transformers 英語

T
google
124.85k
141
T5 Base Question Generator
t5-baseに基づく質問生成モデルで、答えとコンテキストを入力すると、対応する質問を出力します。
質問応答システム
Transformers

T
iarfmoose
122.74k
57
Bert Base Cased Qa Evaluator
BERT-base-casedに基づく質問と回答のペアの評価モデルで、質問と回答が意味的に関連しているかどうかを判断するために使用されます。
質問応答システム
B
iarfmoose
122.54k
9
Tiny Doc Qa Vision Encoder Decoder
MIT
MITライセンスに基づく文書質問応答モデルで、主にテスト目的で使用されます。
質問応答システム
Transformers

T
fxmarty
41.08k
16
Dpr Question Encoder Single Nq Base
DPR(密集パッセージ検索)はオープンドメイン質問応答研究のためのツールとモデルです。このモデルはBERTベースの質問エンコーダーで、Natural Questions(NQ)データセットでトレーニングされています。
質問応答システム
Transformers 英語

D
facebook
32.90k
30
Mobilebert Uncased Squad V2
MIT
MobileBERTはBERT_LARGEの軽量化バージョンで、SQuAD2.0データセットで微調整された質問応答システムモデルです。
質問応答システム
Transformers 英語

M
csarron
29.11k
7
Tapas Base Finetuned Wtq
Apache-2.0
TAPASはTransformerベースの表質問応答モデルで、ウィキペディアの表データで自己教師あり学習により事前学習され、WTQなどのデータセットでファインチューニングされています。
質問応答システム
Transformers 英語

T
google
23.03k
217
Dpr Question Encoder Multiset Base
BERTベースの密集パラグラフ検索(DPR)の質問エンコーダーで、オープンドメイン質問応答研究に使用され、複数のQAデータセットで訓練されています。
質問応答システム
Transformers 英語

D
facebook
17.51k
4
おすすめAIモデル
Llama 3 Typhoon V1.5x 8b Instruct
タイ語専用に設計された80億パラメータの命令モデルで、GPT-3.5-turboに匹敵する性能を持ち、アプリケーションシナリオ、検索拡張生成、制限付き生成、推論タスクを最適化
大規模言語モデル
Transformers 複数言語対応

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-TinyはSODAデータセットでトレーニングされた超小型対話モデルで、エッジデバイス推論向けに設計されており、体積はCosmo-3Bモデルの約2%です。
対話システム
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
RoBERTaアーキテクチャに基づく中国語抽出型QAモデルで、与えられたテキストから回答を抽出するタスクに適しています。
質問応答システム 中国語
R
uer
2,694
98