Skip to content

Commit

Permalink
[no ci] minor edit
Browse files Browse the repository at this point in the history
  • Loading branch information
amaiya committed Mar 31, 2023
1 parent 18f9a0c commit 06d8ea6
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions examples/text/generative_ai_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Notice that the words \"strength\" and \"power\" were used in this description of this men's shirt. We call attention to this, as output of this model may potentially be biased. Such bias may reveal itself more in tasks that are more generative and less extractive in nature like this and the next example."
"Notice that the words \"strength\" and \"power\" were used in this description of this men's shirt. We call attention to this, as output of this model may potentially be biased. Such bias may reveal itself more in tasks that are more generative and less extractive in nature like this and the next examples."
]
},
{
Expand Down Expand Up @@ -377,6 +377,13 @@
"print(model.execute(prompt)) "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Tweet Generation"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -386,31 +393,31 @@
"name": "stdout",
"output_type": "stream",
"text": [
"SELECT * FROM Employee WHERE LAST_NAME = 'Smith' OR LAST_NAME = 'Brown' OR LAST_NAME = 'White';\n",
"Climate change is real and not a distant threat--it's happening now and will affect everyone.\n",
"\n"
]
}
],
"source": [
"prompt = \"\"\"Generate SQL based on the supplied Question. Here are some examples.\n",
"[Question]:\n",
"Fetch the companies that have less than five people in it.\n",
"[Answer]:\n",
"SELECT COMPANY, COUNT(EMPLOYEE_ID) FROM Employee GROUP BY COMPANY HAVING COUNT(EMPLOYEE_ID) < 5;\n",
"prompt = \"\"\"Generate a tweet based on the supplied Keyword. Here are some examples.\n",
"[Keyword]:\n",
"markets\n",
"[Tweet]:\n",
"Take feedback from nature and markets, not from people\n",
"###\n",
"[Question]:\n",
"Show all companies along with the number of employees in each department\n",
"[Answer]:\n",
"SELECT COMPANY, COUNT(COMPANY) FROM Employee GROUP BY COMPANY;\n",
"[Keyword]:\n",
"children\n",
"[Tweet]:\n",
"Maybe we die so we can come back as children.\n",
"###\n",
"[Question]:\n",
"Show the last record of the Employee table\n",
"[Answer]:\n",
"SELECT * FROM Employee ORDER BY LAST_NAME DESC LIMIT 1;\n",
"[Keyword]:\n",
"startups\n",
"[Tweet]: \n",
"Startups should not worry about how to put out fires, they should worry about how to start them.\n",
"###\n",
"[Question]:\n",
"Fetch three employees from the Employee table;\n",
"[Answer]:\"\"\"\n",
"[Keyword]: \n",
"climate change\n",
"[Tweet]:\"\"\"\n",
"print(model.execute(prompt))"
]
},
Expand Down

0 comments on commit 06d8ea6

Please sign in to comment.