Technical requirements
The code files used in this chapter are located at https://github.com/PacktPublishing/Data-Labeling-in-Machine-Learning-with-Python/tree/main/code/Ch07.
The Gutenberg Corpus and movie review dataset can be found here:
- https://pypi.org/project/Gutenberg/
- https://www.nltk.org/api/nltk.sentiment.util.html?highlight=movie#nltk.sentiment.util.demo_movie_reviews
You also need to create an Azure account and add the OpenAI resource for working with Generative AI. To sign up for a free Azure subscription, visit https://azure.microsoft.com/free. To request access to the Azure OpenAI service, visit https://aka.ms/oaiapply.
Once you have provisioned the Azure OpenAI service, set up the following environment variables:
os.environ['AZURE_OPENAI_KEY'] = 'your_api_key' os.environ['AZURE_OPENAI_ENDPOINT") ='your_azure_openai_endpoint'
Your endpoint should look like https://YOUR_RESOURCE_NAME.openai.azure.com...