1
1
---
2
2
title : Fact Dynamics
3
- description : A Flutter app for real -time fact-checking of debate, speech and images uses Perplexity's Sonar API.
3
+ description : Real -time fact-checking Flutter app for debates, speeches, and images using Perplexity's Sonar API
4
4
sidebar_position : 2
5
- keywords : [Sonar API, Flutter, Dart, fact‑ checking, hackathon, real-time, speech-to-text, image-verification]
5
+ keywords : [Sonar API, Flutter, Dart, fact- checking, real-time, speech-to-text, debate , image-verification]
6
6
---
7
7
8
8
# Fact Dynamics
@@ -17,163 +17,61 @@ keywords: [Sonar API, Flutter, Dart, fact‑checking, hackathon, real-time, spee
17
17
/>
18
18
</p >
19
19
20
- Fact Dynamics is a cross‑platform Flutter application that leverages Perplexity's Sonar API to provide real‑time fact‑checking for spoken and visual content—perfect for debates, presentations, or on‑the‑fly image verification. Built as a Perplexity Hackathon submission in the Information Tools & Deep Research & Education categories.
20
+ ** Hackathon Submission ** - Built for Perplexity Hackathon in Information Tools & Deep Research categories.
21
21
22
- ## Features
22
+ Fact Dynamics is a cross-platform Flutter app that provides real-time fact-checking for spoken content and images. Perfect for live debates, presentations, and on-the-fly information verification.
23
23
24
- - ** Real‑time Speech Analysis** - Transcribes live audio (via ` speech_to_text ` ) and fact‑checks each snippet instantly
25
- - ** Image Fact Verification** - Extracts text from images and verifies claims on‑device
26
- - ** Claim Rating System** - Classifies claims as ** TRUE** , ** FALSE** , ** MISLEADING** , or ** UNVERIFIABLE**
27
- - ** Source Citations** - Surfaces authoritative URLs backing each verdict
28
- - ** User Authentication** - Firebase Auth (Google & Email) with secure Firestore persistence
29
- - ** Debate Mode** - Continuous speech recognition with streaming feedback
30
- - ** Cross‑platform** - iOS, Android, Web (macOS testing; Windows coming soon)
31
-
32
- ## Prerequisites
33
-
34
- - Flutter SDK installed on your development machine
35
- - Firebase account for authentication and data persistence
36
- - Perplexity Sonar API key
37
- - Device with microphone access for speech recognition
38
- - Camera access for image capture (optional)
39
-
40
- ## Installation
41
-
42
- 1 . ** Clone the repository**
43
- ``` bash
44
- git clone https://github.com/vishnu32510/fact_pulse.git
45
- cd fact_pulse
46
- ```
24
+ ## What It Does
47
25
48
- 2 . ** Install Flutter dependencies**
49
- ``` bash
50
- flutter pub get
51
- ```
52
-
53
- 3 . ** Configure Firebase for your platform**
54
- - Create a Firebase project at [ Firebase Console] ( https://console.firebase.google.com/ )
55
- - Enable Authentication (Google, Email) and Firestore Database
56
- - Install and configure FlutterFire CLI:
57
- ``` bash
58
- dart pub global activate flutterfire_cli
59
- flutterfire configure
60
- ```
61
- - Follow the prompts to select your Firebase project and platforms (iOS/Android/Web)
62
-
63
- 4 . ** Set up API key**
64
- - Create a ` .env ` file in the project root (use ` .env.template ` as reference)
65
- - Add your Perplexity Sonar API key:
66
- ```
67
- PERPLEXITY_API_KEY=your_api_key_here
68
- ```
69
-
70
- 5 . ** Configure platform permissions**
71
- - For Android: Microphone and camera permissions are configured in ` android/app/src/main/AndroidManifest.xml `
72
- - For iOS: Permissions are configured in ` ios/Runner/Info.plist `
26
+ - ** Real-time Speech Analysis** - Transcribes live audio and fact-checks each snippet instantly
27
+ - ** Image Fact Verification** - Extracts text from images and verifies claims automatically
28
+ - ** Claim Rating System** - Classifies claims as TRUE, FALSE, MISLEADING, or UNVERIFIABLE
29
+ - ** Source Citations** - Provides authoritative URLs backing each verdict
30
+ - ** Debate Mode** - Continuous speech recognition with streaming feedback
31
+ - ** Cross-platform** - Works on iOS, Android, and Web
73
32
74
- 6 . ** Run the application**
75
- ``` bash
76
- flutter run
77
- ```
33
+ ## How It Uses Perplexity
78
34
79
- ## Usage
35
+ ** Real-time Speech Fact-Checking:**
36
+ - Streams 5-second audio chunks through Flutter's ` speech_to_text `
37
+ - Sends transcribed snippets to Sonar API with structured prompts
38
+ - Returns JSON with claims, ratings (TRUE/FALSE/MISLEADING/UNVERIFIABLE), explanations, and sources
80
39
81
- ### Demo & Screenshots
40
+ ** Image Analysis:**
41
+ - Uploads images/URLs to Sonar API for text extraction
42
+ - Verifies extracted claims against authoritative sources
43
+ - Provides comprehensive analysis with source attribution
82
44
83
- - [ Watch the demo video] ( https://youtu.be/92IoX19Djtc )
84
- - [ Web Demo] ( https://fact-pulse.web.app/ )
45
+ ## Screenshots
85
46
86
47
<table >
87
48
<tr >
88
- <td >
89
- <img
90
- src = " https://raw.githubusercontent.com/vishnu32510/fact_pulse/main/assets/screenshots/1.%20Login.png"
91
- alt = " Login screen"
92
- width = " 200"
93
- />
94
- </td >
95
49
<td >
96
50
<img
97
51
src = " https://raw.githubusercontent.com/vishnu32510/fact_pulse/main/assets/screenshots/2.%20Dashboard.png"
98
52
alt = " Dashboard"
99
53
width = " 200"
100
54
/>
101
55
</td >
102
- <td >
103
- <img
104
- src = " https://raw.githubusercontent.com/vishnu32510/fact_pulse/main/assets/screenshots/5.%20Profile.png"
105
- alt = " Profile screen"
106
- width = " 200"
107
- />
108
- </td >
109
- </tr >
110
- </table >
111
-
112
- <table >
113
- <tr >
114
- <td >
115
- <img
116
- src = " https://raw.githubusercontent.com/vishnu32510/fact_pulse/main/assets/screenshots/3.%20Facts%20Checked%20List(Speech,%20Debate,%20Image).png"
117
- alt = " Facts checked list"
118
- width = " 300"
119
- />
120
- </td >
121
56
<td >
122
57
<img
123
58
src = " https://raw.githubusercontent.com/vishnu32510/fact_pulse/main/assets/screenshots/4.%20Fact%20Checks(Speech,%20Debate,%20Image).png"
124
- alt = " Fact checks screen "
125
- width = " 300 "
59
+ alt = " Fact checking interface "
60
+ width = " 200 "
126
61
/>
127
62
</td >
128
63
</tr >
129
64
</table >
130
65
131
- 1 . ** Authentication** : Sign in with Google or email through Firebase Auth
132
- 2 . ** Speech Mode** : Tap the microphone to start real-time speech transcription and fact-checking
133
- 3 . ** Image Mode** : Upload an image or provide a URL to extract and verify text claims
134
- 4 . ** Debate Mode** : Enable continuous speech recognition for live debate fact-checking
135
- 5 . ** View Results** : Check claim ratings, explanations, and source citations
136
-
137
- ## Code Explanation
138
-
139
- ### Perplexity Sonar API Integration
140
-
141
- The app integrates with Perplexity's Sonar API in two main ways:
142
-
143
- 1 . ** Debate Fact‑Checking**
144
- - Stream 5‑second audio chunks → transcribe → send ` textSnippet ` to Sonar
145
- - Parse JSON response for ` { claim, rating, explanation, sources } `
146
-
147
- 2 . ** Image Analysis**
148
- - Upload or URL‑point to image → Sonar extracts on‑image text → verify each claim
149
-
150
- ``` dart
151
- final client = PerplexityClient(apiKey: env.SONAR_API_KEY);
152
- final response = await client.analyzeClaim(textSnippet);
153
- print('Rating: ${response.rating}, Confidence: ${response.confidence}');
154
- ```
155
-
156
- The app processes audio in real-time, transcribes it using Flutter's speech-to-text package, and sends each snippet to the Sonar API for immediate fact verification with source citations.
157
-
158
- ### Custom SDKs Used
159
-
160
- This project uses custom-built Perplexity API SDKs developed specifically for this hackathon:
161
- - ** perplexity_dart** - Core Dart SDK ([ pub.dev] ( https://pub.dev/packages/perplexity_dart ) , [ docs] ( perplexity-flutter ) )
162
- - ** perplexity_flutter** - Flutter widgets and utilities ([ pub.dev] ( https://pub.dev/packages/perplexity_flutter ) , [ docs] ( perplexity-flutter ) )
163
-
164
- ## Links
66
+ ## Open Source SDKs
165
67
166
- - [ GitHub Repository] ( https://github.com/vishnu32510/fact_pulse )
167
- - [ Live Demo] ( https://fact-pulse.web.app/ )
168
- - [ Devpost Submission] ( https://devpost.com/software/fact-dynamics )
169
- - [ Demo Video] ( https://youtu.be/92IoX19Djtc )
68
+ Built two reusable packages for the Flutter community:
69
+ - ** [ perplexity_dart] ( https://pub.dev/packages/perplexity_dart ) ** - Core Dart SDK for Perplexity API
70
+ - ** [ perplexity_flutter] ( https://pub.dev/packages/perplexity_flutter ) ** - Flutter widgets and BLoC integration
170
71
171
- ## Limitations
72
+ ## Key Links
172
73
173
- - Speech recognition accuracy depends on audio quality and background noise
174
- - Fact-checking is limited to claims that can be verified through available online sources
175
- - Image text extraction quality varies based on image resolution and text clarity
176
- - Real-time processing may experience latency depending on network connectivity
177
- - Cross-platform compatibility is still being tested for macOS and Windows
178
- - API rate limits may affect continuous usage in high-volume scenarios
179
- - Android microphone access permissions need to be added for long duration listening
74
+ - ** [ GitHub Repository] ( https://github.com/vishnu32510/fact_pulse ) ** - Full source code
75
+ - ** [ Live Demo] ( https://fact-pulse.web.app/ ) ** - Try the web version
76
+ - ** [ Demo Video] ( https://youtu.be/92IoX19Djtc ) ** - Watch it in action
77
+ - ** [ Devpost Submission] ( https://devpost.com/software/fact-dynamics ) ** - Hackathon entry
0 commit comments