Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 946 Bytes

File metadata and controls

20 lines (14 loc) · 946 Bytes

Python - OpenAI API script

The following script opens a CSV file, runs reviews of the imaginary application taken from it through OpenAI API, which rates them on a scale of 1-10 based on the tone of the review. The reviews are then being sorted based on the given rate and saved as a separate CSV file into the same directory.

To run the script on a local machine, one should:

  • Download the code archive
  • Open the code directory with an appropriate IDE
  • Install the required dependencies with pip install -r requirements.txt command
  • Implement an environmental variable that will store your OpenAI API key with the name "OPENAI_API_KEY"

The sample input file is presented within the code directory and is called 'Reviews.csv', however one could replace that file or data within the file with one of their own, preserving the file structure and format.