This script uses the GPT-3.5-turbo model from OpenAI to summarize a transcript into bullet points. The generated bullet points will include relevant details such as numbers, people, or company names, while ignoring timestamps. The input transcript is read from a text file and the summarized bullet points are written to another text file.
- Python 3
- An OpenAI API key
- The
openai
library installed in your Python environment
-
Save the input transcript in a text file named 'Ed-and-AppWorks.txt', where each item is separated by commas.
-
Set your OpenAI API key as an environment variable or replace the placeholder value in the script:
openai.api_key = 'your-api-key-here'
- Run the script:
python3 script_name.py
Replace script_name.py
with the name you saved the script as.
- The script will create an output file named 'output.txt', containing the summarized bullet points generated by the GPT-3.5-turbo model.
The script performs the following steps:
- Reads the content of the input file 'Ed-and-AppWorks.txt'.
- Splits the content into items based on commas.
- Converts the item list to a string.
- Sets the OpenAI API key.
- Initializes a loop that processes the input text in chunks of 4000 characters or less.
- Makes a request to the GPT-3.5-turbo model with the current chunk, asking the model to rewrite the transcript into bullet points, including relevant details and ignoring timestamps.
- Appends the generated bullet points to an output string.
- Writes the output string to the output file 'output.txt'.
- Prints "Done" when the process is complete.
This project is provided under the MIT License.