You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/doc/docs/extensions/huggingface-table-question-answering.mdx
+29-5Lines changed: 29 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,9 @@ The [Table Question Answering](https://huggingface.co/docs/api-inference/detaile
42
42
43
43
Using the `huggingface_table_question_answering` filter.
44
44
45
-
Sample 1:
45
+
The result will be converted to a JSON string from `huggingface_table_question_answering`. You could decompress the JSON string and use the result by itself.
46
+
47
+
**Sample 1 - send the data from variable by [set tag](https://vulcansql.com/docs/develop/advance#set-variables):**
46
48
47
49
```sql
48
50
{% set data = [
@@ -67,14 +69,36 @@ Sample 1:
67
69
SELECT {{ data | huggingface_table_question_answering(query="How many repositories related to data-lake topic?") }}
**Sample 2 - send the data from [req tag](https://vulcansql.com/docs/develop/predefined-queries):**
71
83
72
84
```sql
73
-
{% req products %}
74
-
SELECT * FROM products
85
+
{% req artists %}
86
+
SELECT * FROM artists
75
87
{% endreq %}
76
88
77
-
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) }}
89
+
{% set question = "List display name where gender are female?" %}
Copy file name to clipboardExpand all lines: packages/extension-huggingface/README.md
+30-6Lines changed: 30 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,9 @@ The [Table Question Answering](https://huggingface.co/docs/api-inference/detaile
33
33
34
34
Using the `huggingface_table_question_answering` filter.
35
35
36
-
Sample 1:
36
+
The result will be converted to a JSON string from `huggingface_table_question_answering`. You could decompress the JSON string and use the result by itself.
37
+
38
+
**Sample 1 - send the data from variable by [set tag](https://vulcansql.com/docs/develop/advance#set-variables):**
37
39
38
40
```sql
39
41
{% set data = [
@@ -55,18 +57,40 @@ Sample 1:
55
57
] %}
56
58
57
59
-- The source data for "huggingface_table_question_answering" needs to be an array of objects.
58
-
SELECT {{ data | huggingface_table_question_answering(query="How many repositories related to data-lake topic?") }}
60
+
SELECT {{ data | huggingface_table_question_answering(query="How many repositories related to data-lake topic?") }} as result
**Sample 2 - send the data from [req tag](https://vulcansql.com/docs/develop/predefined-queries):**
62
74
63
75
```sql
64
-
{% req products %}
65
-
SELECT * FROM products
76
+
{% req artists %}
77
+
SELECT * FROM artists
66
78
{% endreq %}
67
79
80
+
{% set question = "List display name where gender are female?" %}
81
+
68
82
-- The "model" keyword argument is optional. If not provided, the default value is 'google/tapas-base-finetuned-wtq'.
69
83
-- The "wait_for_model" keyword argument is optional. If not provided, the default value is false.
70
84
-- The "use_cache" keyword argument is optional. If not provided, the default value is true.
71
-
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) }}
// result format, convert to suitable FunctionalFilter response => https://huggingface.co/docs/api-inference/detailed_parameters#question-answering-task
0 commit comments