|
| 1 | +# Statement Truth Evaluation using OpenAI GPT-3 |
| 2 | + |
| 3 | +This repository contains a Python script that uses the OpenAI GPT-3 model to evaluate the truth or falsehood of statements in a given list. The script sends each statement as a prompt to the GPT-3 model and analyzes the model's response to determine whether the statement is considered true or false according to the model's understanding. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Python 3.x |
| 8 | +- Install the `openai` package using the following command: |
| 9 | + |
| 10 | + ```bash |
| 11 | + pip install openai |
| 12 | + ``` |
| 13 | + |
| 14 | +## Getting Started |
| 15 | + |
| 16 | +1. Clone this repository to your local machine: |
| 17 | + |
| 18 | + ```bash |
| 19 | + git clone https://github.com/your-username/gpt3-statement-evaluation.git |
| 20 | + ``` |
| 21 | + |
| 22 | +2. Navigate to the repository's directory: |
| 23 | + |
| 24 | + ```bash |
| 25 | + cd gpt3-statement-evaluation |
| 26 | + ``` |
| 27 | + |
| 28 | +3. Set up your OpenAI API key by replacing `'YOUR_API_KEY'` with your actual OpenAI API key in the `evaluate_statements.py` file. |
| 29 | + |
| 30 | +4. Run the script using your Python interpreter: |
| 31 | + |
| 32 | + ```bash |
| 33 | + python evaluate_statements.py |
| 34 | + ``` |
| 35 | + |
| 36 | +## Usage |
| 37 | + |
| 38 | +The `evaluate_statements.py` script in this repository demonstrates how to use the OpenAI GPT-3 model to assess the truth or falsehood of statements. It performs the following steps for each statement: |
| 39 | + |
| 40 | +1. Constructs a prompt using the statement to be evaluated. |
| 41 | +2. Sends the prompt to the GPT-3 model using the OpenAI Python package. |
| 42 | +3. Extracts and prints the model's response, indicating whether the statement is considered true or false. |
| 43 | + |
| 44 | +Please note that the accuracy of the truth evaluation depends on the training data and capabilities of the GPT-3 model. This approach might not always provide accurate results, especially for statements that require specific domain knowledge or factual accuracy. Always verify critical information from reliable sources. |
| 45 | + |
| 46 | +## Example Output |
| 47 | + |
| 48 | +``` |
| 49 | +Statement: The sun rises in the west. |
| 50 | +Answer: False |
| 51 | +---------------------------- |
| 52 | +Statement: Water boils at 100 degrees Celsius. |
| 53 | +Answer: False |
| 54 | +---------------------------- |
| 55 | +Statement: Cats are reptiles. |
| 56 | +Answer: False |
| 57 | +---------------------------- |
| 58 | +Statement: The capital of France is Paris. |
| 59 | +Answer: True |
| 60 | +---------------------------- |
| 61 | +Statement: Gravity makes things fall downward. |
| 62 | +Answer: True |
| 63 | +---------------------------- |
| 64 | +``` |
| 65 | + |
| 66 | +## Important Note |
| 67 | + |
| 68 | +Ensure that you handle your API keys securely and follow OpenAI's terms of service and usage guidelines. This example provides a starting point for using the GPT-3 model to evaluate the truth or falsehood of statements. |
| 69 | + |
| 70 | +For more detailed information about the OpenAI API and its capabilities, refer to the [official documentation](https://beta.openai.com/docs/). |
| 71 | + |
0 commit comments