Skip to content

Commit 2e265dd

Browse files
Merge branch 'main' into feature/rename_more_udfs
2 parents 0c71d61 + 685e928 commit 2e265dd

File tree

50 files changed

+226
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+226
-223
lines changed

doc/changes/changes_1.0.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The 'token_conn' parameter was removed from the UDF calls. You can now call the
1616
as follows (Example case for the filling mask udf):
1717

1818
```sql
19-
SELECT TE_FILLING_MASK_UDF(
19+
SELECT AI_FILL_MASK_EXTENDED(
2020
device_id,
2121
bucketfs_conn,
2222
sub_dir,

doc/developer_guide/developer_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Users should implement the following methods in the UDF class
118118
that extends the `BaseModel UDF`:
119119
- `extract_unique_param_based_dataframes` : Even if the data in a given
120120
dataframe all have the same model, there might be differences within the given
121-
dataframe with different model parameters (e.g. _top_k_ parameter in [FillingMaskUDF](../../exasol_transformers_extension/udfs/models/filling_mask_udf.py)).
121+
dataframe with different model parameters (e.g. _top_k_ parameter in [AIFillMaskExtendedUDF](../../exasol_transformers_extension/udfs/models/ai_fill_mask_extended_udf.py)).
122122
This method is responsible for extracting unique dataframes which share both the
123123
same model and model parameters.
124124
- `execute_prediction` : Performs prediction on a given text list using

doc/user_guide/invoke_models.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ We provide 7 prediction UDFs in the Transformers Extension package. Each perform
44

55
### Table of Contents
66

7-
* [Sequence Classification for Single Text UDF](#sequence-classification-for-single-text-udf)
8-
* [Sequence Classification for Text Pair UDF](#sequence-classification-for-text-pair-udf)
7+
8+
* [AI Custom Classify Extended](#ai-custom-classify-extended)
9+
* [AI Entailment Extended](#ai-entailment-extended)
910
* [AI Answer Extended](#ai-answer-extended)
1011
* [Masked Language Modelling UDF](#masked-language-modelling-udf)
1112
* [AI Complete Extended](#ai-complete-extended)
@@ -14,14 +15,14 @@ We provide 7 prediction UDFs in the Transformers Extension package. Each perform
1415
* [AI Classify Extended](#ai-classify-extended)
1516

1617

17-
### Sequence Classification for Single Text UDF
18+
### AI Custom Classify Extended
1819

1920
This UDF classifies the given text according to a given number of classes of the specified model.
2021

2122
Example usage:
2223

2324
```sql
24-
SELECT TE_SEQUENCE_CLASSIFICATION_SINGLE_TEXT_UDF(
25+
SELECT AI_CUSTOM_CLASSIFY_EXTENDED(
2526
device_id,
2627
bucketfs_conn,
2728
sub_dir,
@@ -54,14 +55,14 @@ Example:
5455
| conn_name | dir/ | model_name | text 1 | ALL | label_2 | 0.23 | 2 | None |
5556
| ... | ... | ... | ... | ... | ... | ... | ... | ... |
5657

57-
### Sequence Classification for Text Pair UDF
58+
### AI Entailment Extended
5859

59-
This UDF takes two input sequences and compares them. Among other things, it can be used to determine if two sequences are paraphrases of each other.
60+
This UDF takes two input texts and compares them. Among other things, it can be used to determine if two texts are paraphrases of each other.
6061

6162
Example usage:
6263

6364
```sql
64-
SELECT TE_SEQUENCE_CLASSIFICATION_TEXT_PAIR_UDF(
65+
SELECT AI_ENTAILMENT_EXTENDED(
6566
device_id,
6667
bucketfs_conn,
6768
sub_dir,
@@ -144,12 +145,16 @@ Example:
144145

145146
### Masked Language Modelling UDF
146147

147-
This UDF is responsible for masking tokens in a given text with a masking token, and then filling that masks with appropriate tokens. The masking token of this UDF is ```<mask>```.
148+
This UDF needs to be given an input text containing the ```<mask>``` token. It can then
149+
replace these masks with appropriate tokens.
150+
I.E the input text could be "<mask> is the best database Software for Machine
151+
Learning Enthusiasts.", resulting in an output like "Exasol is the best database
152+
Software for Machine Learning Enthusiasts."
148153

149154
Example usage:
150155

151156
```sql
152-
SELECT TE_FILLING_MASK_UDF(
157+
SELECT AI_FILL_MASK_EXTENDED(
153158
device_id,
154159
bucketfs_conn,
155160
sub_dir,

doc/user_guide/user_guide.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ The extension provides two types of UDFs:
88

99
* Utility UDFs: UDFs which deal with installation and deletion of pretrained Transformers models in the Exasol BucketFS.
1010
* Prediction UDFs: These are a group of UDFs for each supported task. Each of them uses the downloaded pre-trained model and performs prediction. These are the supported tasks:
11-
1. Sequence Classification for Single Text
12-
2. Sequence Classification for Text Pair
11+
12+
1. AI Custom Classify Extended
13+
2. AI Entailment Extended
1314
3. AI Answer Extended
1415
4. Masked Language Modelling
1516
5. AI Complete Extended

exasol_transformers_extension/deployment/constants.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
UDF_CALL_TEMPLATES = {
1010
"model_downloader_udf_call.py": "model_downloader_udf.jinja.sql",
1111
"ls_models_udf.py": "ls_models_udf.jinja.sql",
12-
"sequence_classification_single_text_udf_call.py": "sequence_classification_single_text_udf.jinja.sql",
13-
"sequence_classification_text_pair_udf_call.py": "sequence_classification_text_pair_udf.jinja.sql",
12+
"ai_custom_classify_extended_udf_call.py": "ai_custom_classify_extended_udf.jinja.sql",
13+
"ai_entailment_extended_udf_call.py": "ai_entailment_extended_udf.jinja.sql",
1414
"ai_answer_extended_udf_call.py": "ai_answer_extended_udf.jinja.sql",
15-
"filling_mask_udf_call.py": "filling_mask_udf.jinja.sql",
15+
"ai_fill_mask_extended_udf_call.py": "ai_fill_mask_extended_udf.sql",
1616
"ai_complete_extended_udf_call.py": "ai_complete_extended_udf.jinja.sql",
1717
"ai_translate_extended_udf_call.py": "ai_translate_extended_udf.jinja.sql",
1818
"delete_model_udf_call.py": "delete_model_udf.jinja.sql",

exasol_transformers_extension/resources/templates/sequence_classification_single_text_udf.jinja.sql renamed to exasol_transformers_extension/resources/templates/ai_custom_classify_extended_udf.jinja.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CREATE OR REPLACE {{ language_alias }} SET SCRIPT "TE_SEQUENCE_CLASSIFICATION_SINGLE_TEXT_UDF"(
1+
CREATE OR REPLACE {{ language_alias }} SET SCRIPT "AI_CUSTOM_CLASSIFY_EXTENDED"(
22
device_id INTEGER,
33
bucketfs_conn VARCHAR(2000000),
44
sub_dir VARCHAR(2000000),

exasol_transformers_extension/resources/templates/sequence_classification_text_pair_udf.jinja.sql renamed to exasol_transformers_extension/resources/templates/ai_entailment_extended_udf.jinja.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CREATE OR REPLACE {{ language_alias }} SET SCRIPT "TE_SEQUENCE_CLASSIFICATION_TEXT_PAIR_UDF"(
1+
CREATE OR REPLACE {{ language_alias }} SET SCRIPT "AI_ENTAILMENT_EXTENDED"(
22
device_id INTEGER,
33
bucketfs_conn VARCHAR(2000000),
44
sub_dir VARCHAR(2000000),

exasol_transformers_extension/resources/templates/filling_mask_udf.jinja.sql renamed to exasol_transformers_extension/resources/templates/ai_fill_mask_extended_udf.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CREATE OR REPLACE {{ language_alias }} SET SCRIPT "TE_FILLING_MASK_UDF"(
1+
CREATE OR REPLACE {{ language_alias }} SET SCRIPT "AI_FILL_MASK_EXTENDED"(
22
device_id INTEGER,
33
bucketfs_conn VARCHAR(2000000),
44
sub_dir VARCHAR(2000000),
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from exasol_transformers_extension.udfs.models.ai_custom_classify_extended_udf import (
2+
AiCustomClassifyUDF,
3+
)
4+
5+
udf = AiCustomClassifyUDF(exa)
6+
7+
8+
def run(ctx):
9+
return udf.run(ctx)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from exasol_transformers_extension.udfs.models.ai_entailment_extended_udf import (
2+
AiEntailmentExtendedUDF,
3+
)
4+
5+
udf = AiEntailmentExtendedUDF(exa)
6+
7+
8+
def run(ctx):
9+
return udf.run(ctx)

0 commit comments

Comments
 (0)