Inspiration
My inspiration for this project came via two parts. One of them was my interest in AI and urge to dive deeper into it. The other was from a few days ago, when I saw videos of people preventing their children from getting vaccines, and not getting vaccines themselves. To me the idea seemed absurd, but what felt even more absurd was that one did not believe it was absurd. This video showed me the power of misinformation, and caused me to start thinking on how to fight it.
What it does
A user submits a url. After submitting, the user gets transported to a different page which shows a detailed score of the source, split into 5 topics, which are then split into other subtopics. The page also displays "red flags" from the source, or terminology that indicates bias/exaggeration, claims that the source makes, and all corporations involved with the source.
How I built it
I built it using Django Rest Framework on the backend and React on the frontend. The frontend will send an api request to the backend with url as a part of the body. Taking this request, the backend will use SeleniumURLLoader to load the source's webpage. Then it creates two prompts (with the content as context) where the AI will respond in JSON, which will then be sent to frontend. The AI itself is locally hosted on my laptop using Ollama.
Challenges I ran into
I ran into a major challenge of the AI responding with plain text along with JSON. No matter how much I changed the prompt to the AI, the AI still included plain text. It got to the point where I had to tell the AI not to do it five times in one prompt, but it still did. After thirty minutes of bashing my head and furiously asking Claude how to edit my prompt, I finally realized that no matter how much I change my prompt, the AI would never abide by it. So, I solved the problem outside of the prompt, by deleting all other text outside of the main curly braces. After a few different attempts, I asked Claude to help me, and it gave me a regex solution. This solution, paired with my solution for the other prompt, finally worked and fixed the AI output.
Accomplishments that I'm proud of
I am proud of locally hosting a small Ollama model and fixing its outputs.
What I learned
I learned more about Retrieval Augmentation Generation pipelines. I also learned more about webpage loaders, as in the middle of the project I attempted to switch to PlaywrightURLLoader, causing me to discover more about arguments passed to it. Also, I learned to keep try/except blocks in mind when debugging.
What's next for Good-formation
I think that in the future, I can include this app as a part of a bigger app, and to solve a bigger problem. On top of this, in the future, I will try to make the processing faster by finding where inefficiencies in my code are.
Log in or sign up for Devpost to join the conversation.