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: pgml-extension/examples/transformers.sql
+50-79Lines changed: 50 additions & 79 deletions
Original file line number
Diff line number
Diff line change
@@ -32,89 +32,60 @@ SELECT pgml.transform(
32
32
'Dominic Cobb is the foremost practitioner of the artistic science of extraction, inserting oneself into a subject''s dreams to obtain hidden information without the subject knowing, a concept taught to him by his professor father-in-law, Dr. Stephen Miles. Dom''s associates are Miles'' former students, who Dom requires as he has given up being the dream architect for reasons he won''t disclose. Dom''s primary associate, Arthur, believes it has something to do with Dom''s deceased wife, Mal, who often figures prominently and violently in those dreams, or Dom''s want to "go home" (get back to his own reality, which includes two young children). Dom''s work is generally in corporate espionage. As the subjects don''t want the information to get into the wrong hands, the clients have zero tolerance for failure. Dom is also a wanted man, as many of his past subjects have learned what Dom has done to them. One of those subjects, Mr. Saito, offers Dom a job he can''t refuse: to take the concept one step further into inception, namely planting thoughts into the subject''s dreams without them knowing. Inception can fundamentally alter that person as a being. Saito''s target is Robert Michael Fischer, the heir to an energy business empire, which has the potential to rule the world if continued on the current trajectory. Beyond the complex logistics of the dream architecture of the case and some unknowns concerning Fischer, the biggest obstacles in success for the team become worrying about one aspect of inception which Cobb fails to disclose to the other team members prior to the job, and Cobb''s newest associate Ariadne''s belief that Cobb''s own subconscious, especially as it relates to Mal, may be taking over what happens in the dreams.'
'Hugging Face is a French company based in New York City.'
77
+
],
78
+
task=>'token-classification'
75
79
);
76
-
SELECTpgml.predict('IMDB Review Sentiment', 'I love SQL');
77
80
78
-
SELECTpgml.load_dataset('squad_v2');
79
-
SELECTpgml.tune(
80
-
'SQuAD Q&A v2',
81
+
SELECTpgml.transform(
81
82
'question-answering',
82
-
'pgml.squad_v2',
83
-
'answers',
84
-
'deepset/roberta-base-squad2',
85
-
hyperparams =>'{
86
-
"evaluation_strategy": "epoch",
87
-
"learning_rate": 2e-5,
88
-
"per_device_train_batch_size": 16,
89
-
"per_device_eval_batch_size": 16,
90
-
"num_train_epochs": 1,
91
-
"weight_decay": 0.01,
92
-
"max_length": 384,
93
-
"stride": 128
94
-
}',
95
-
test_size =>11873,
96
-
test_sampling =>'last'
97
-
);
83
+
inputs => ARRAY[
84
+
'{
85
+
"question": "Am I dreaming?",
86
+
"context": "I got a good nights sleep last night and started a simple tutorial over my cup of morning coffee. The capabilities seem unreal, compared to what I came to expect from the simple SQL standard I studied so long ago. The answer is staring me in the face, and I feel the uncanny call from beyond the screen to check the results."
0 commit comments