InFact is a news corroboration platform that fights media bias. Give it a news article URL and it finds a story covering the same event from an outlet with an opposing political lean, then uses GPT-4 to synthesize an unbiased summary with direct quotes from both sources.
- Clone the repo and
cd infact - Create a
.envfile with the following keys:
SUPABASE_URL=
SUPABASE_KEY=
NEWS_API_KEY=
GOOGLE_API_KEY=
OPENAI_API_KEY=
Docker (recommended):
# Build
docker build -t infact .
# Run (detached / server)
docker run --name infact -d -p 8000:8000 infact
# Run (interactive / local debug)
docker run --name infact -it -p 8000:8000 infact
# Stop
docker stop --signal SIGKILL infactWithout Docker:
pip install -r requirements.txt
python main.pyApp runs at http://localhost:8000.
- A user submits a news article URL.
- InFact determines the political bias of the source using AllSides data.
- It searches Google for coverage of the same story from an outlet with the opposite bias.
- Both articles are sent to GPT-4-turbo, which writes a 3-paragraph corroboration with quotes attributed to each source.
- The result is displayed alongside political lean indicators for both outlets.
Extracts the body text of a news article.
extractText("https://example.com/article")
# Returns: plain text string of article contentCorroborates two news articles into a single synthesis.
corroborate("https://cnn.com/...", "https://abcnews.go.com/...")
# Returns: corroborated string (may take several seconds)Converts newlines to <br> tags for HTML rendering.
textToHTML("Line one\n\nLine two")
# Returns: "Line one<br><br>Line two"