Skip to content

Question answering on a table #1356

Open
@avantikajain

Description

@avantikajain

I want to run the table-question-answering task on my table residing in postgres. I have tried using pg.transform() function to acheive the same. My query:
SELECT
vendor_name,
pgml.transform(
task => '{"task": "table-question-answering"
}'::JSONB,
inputs => ARRAY['{"question":"How many distinct vendors are present",
"table":"vendor_name"}']
-- inputs => array[vendor_name]
)
FROM pgml.vendor_summary
WHERE vendor_name IS NOT NULL
LIMIT 10;

Traceback:
ERROR: Traceback (most recent call last):
File "", line 196, in transform
File "", line 168, in call
File "/var/lib/postgresml/pgml-venv/lib/python3.10/site-packages/transformers/pipelines/table_question_answering.py", line 348, in call
pipeline_inputs = self._args_parser(*args, **kwargs)
File "/var/lib/postgresml/pgml-venv/lib/python3.10/site-packages/transformers/pipelines/table_question_answering.py", line 56, in call
raise ValueError(
ValueError: Keyword argument table should be a list of dict, but is <generator object TableQuestionAnsweringArgumentHandler.call.. at 0x7f9f511fa3b0>

SQL state: XX000

Wanted to know the correct syntax of the sql query to do question answering on existing table using postgresml

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions