Skip to content

Latest commit

 

History

History

table-question-answering

Table Question Answering

The project demonstrates how VulcanSQL can leverage the power of Hugging Face Table Question Answering through the huggingface_table_question_answering filter to perform simple data queries.

Datasets: https://www.kaggle.com/datasets/chasewillden/topstarredopensourceprojects

Used DuckDB connector be the data source and get the CSV result from DuckDB function.

Setup

  1. Install VulcanSQL CLI package, here use yarn, you could use npm by yourself.
$ yarn install -g @vulcan-sql/cli
  1. Go to the project directory and install all the packages from package.json
$ yarn install
  1. Create your HuggingFace User Access Token and add to vulcan.yaml:
hf:
  accessToken: "<your access token>"
  1. Start VulcanSQL in the terminal
$ vulcan start --watch

Now the API docs is auto generated at http://localhost:3000/doc and API /repositories already.

Screenshot

API Document

API Document

API Request & Response

Here We use Postman to send API Request.

  1. Send the Find the repository has the most stars? question by query string:

Find the repository has the most stars?

VulcanSQL responds to the HuggingFace Table Question Answering original output, but converts it to a JSON string.

  1. Send the How many repositories use Python language? Give repository name question by query string:

How many repositories use Python language? Give repository name

Same output format as the above, VulcanSQL responds to the HuggingFace Table Question Answering original output, but converts it to a JSON string.

References

For more information about VulcanSQL huggingface_table_question_answering filter, please see HuggingFace extension.