Created
January 9, 2023 19:57
-
-
Save maxcountryman/e164cd42466ee808da2776d18afda8cb to your computer and use it in GitHub Desktop.
Generating tags with GPT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo -e $(curl -s https://api.openai.com/v1/completions \ | |
-H "Content-Type: application/json" \ | |
-H "Authorization: Bearer $OPENAI_API_KEY" \ | |
-d '{"model": "text-davinci-003", "prompt": "Extract tags from the following text. Limit five tags. Output JSON.\\n\\nText: Folksonomy is a classification system in which end users apply public tags to online items, typically to make those items easier for themselves or others to find later. Over time, this can give rise to a classification system based on those tags and how often they are applied or searched for, in contrast to a taxonomic classification designed by the owners of the content and specified when it is published.[1][2] This practice is also known as collaborative tagging,[3][4] social classification, social indexing, and social tagging.\\n\\n<Output>", "temperature": 0, "max_tokens": 1000}' | jq .choices[0].text) | tr -d '\\' | sed -r 's/^"|"$//g' | jq .tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Extract tags from the following text. Limit five tags. Output JSON. | |
Text: <Text> | |
<Output> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment