Skip to main content

Table Question Answering

The Table Question Answering is one of the Natural Language Processing tasks supported by Hugging Face.

Using the huggingface_table_question_answering filter.

Sample 1:

{% set data = [
{
"repository": "vulcan-sql",
"topic": ["analytics", "data-lake", "data-warehouse", "api-builder"],
"description":"Create and share Data APIs fast! Data API framework for DuckDB, ClickHouse, Snowflake, BigQuery, PostgreSQL"
},
{
"repository": "accio",
"topic": ["data-analytics", "data-lake", "data-warehouse", "bussiness-intelligence"],
"description": "Query Your Data Warehouse Like Exploring One Big View."
},
{
"repository": "hell-word",
"topic": [],
"description": "Sample repository for testing"
}
] %}

-- The source data for "huggingface_table_question_answering" needs to be an array of objects.
SELECT {{ data | huggingface_table_question_answering(query="How many repositories related to data-lake topic?") }}

Sample 2:

{% req products %}
SELECT * FROM products
{% endreq %}

SELECT {{ products.value() | huggingface_table_question_answering(query="How many products related to 3C type?", model="microsoft/tapex-base-finetuned-wtq", wait_for_model=true, use_cache=true) }}

Arguments

Please check Table Question Answering for further information.

NameRequiredDefaultDescription
queryYThe query in plain text that you want to ask the table.
modelNgoogle/tapas-base-finetuned-wtqThe model id of a pretrained model hosted inside a model repo on huggingface.co. See: https://huggingface.co/models?pipeline_tag=table-question-answering
use_cacheNtrueThere is a cache layer on the inference API to speedup requests we have already seen
wait_for_modelNfalseIf the model is not ready, wait for it instead of receiving 503. It limits the number of requests required to get your inference done