- Utilizes GPT-4o to extract factual claims from input text
- Fine-tunes GPT-4o's performance for identifying and judging nutrientional/health related claims.
- Reformats claims into queries optimized for Wolfram Alpha
- Processes claims through Wolfram Alpha for mathematical/factual accuracy
- Generates JSON records of claims, verification steps, and results
- Maintains a timestamped history of all fact-checking operations
- Clone the repository
- Install dependencies:
pip install -r requirements.txtpython app.pyThe server will start at http://localhost:5000.
URL: /api/fact-check
Method: POST
Content-Type: application/json
Request Body:
{
"text": "The radius of the Earth is 6,371 kilometers. The speed of light is approximately 300,000 kilometers per second."
}Response:
[
{
"claim": "The radius of the Earth is 6,371 kilometers.",
"wolfram_query": "What is the radius of the Earth in kilometers?",
"wolfram_response": "Earth radius ≈ 6371 km",
"verification": "True"
},
{
"claim": "The speed of light is approximately 300,000 kilometers per second.",
"wolfram_query": "What is the speed of light in kilometers per second?",
"wolfram_response": "Speed of light = 299,792 km/s",
"verification": "Approximately True"
}
]curl -X POST http://localhost:5000/api/fact-check \
-H "Content-Type: application/json" \
-d '{"text":"The radius of the Earth is 6,371 kilometers. The speed of light is approximately 300,000 kilometers per second."}'import requests
import json
url = "http://localhost:5000/api/fact-check"
payload = {
"text": "The radius of the Earth is 6,371 kilometers. The speed of light is approximately 300,000 kilometers per second."
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, data=json.dumps(payload), headers=headers)
print(response.json())