💡 Inspiration
How can we use technology to provide quality education for populations in need? To us, education isn’t only learning new concepts, formulas, or facts. Education is just as much about knowing what you know and why you know it.
"Pro-abortion forces broke the bank to convince voters abortion extremism is normal. They failed"
— Fox News, 2022
On news websites around the world, articles like the above exist. Articles designed to appeal to your emotions rather than your logical judgment. In developed parts of the world, this tactic is used extensively to manipulate, mislead, and miseducate.
Moonlit, our project for Hack the Change 2022, is designed to counter this tactic using natural language processing to educate on biased and emotionally charged statements within articles.
🌙 What it does
Moonlit is a web app that allows users to identify bias and emotionally charged statements in an article. Moonlit detects the primary emotion the writer is trying impose on the reader in each paragraph. Using natural language processing and state-of-the-art machine learning technologies, we’ve optimized Moonlit to work within seconds, making it easier than ever to identify the intent of an article.
🔧 How we built it

When the user enters a URL, they interact with our front-end built with React, NextJS, and Typescript. This URL is sent to the backend (in FastAPI), hosted on AWS, where we use newspaper3k to scrape the contents (headline, author, images). Then, the backend runs the text of the article through two deep learning models. The first is a 20-billion parameter autoregressive transformer, GPT-NeoX-20B, which is hosted on the Goose.ai API. We use in-context learning to allow GPT to identify the emotions in each paragraph that the reader may feel. The second is a model to detect political leaning with BigBird, which we fine-tuned (using Hugging Face) ourselves from AllSides data, with four GTX 1080Ti’s. After the backend runs these two models, it returns the predictions to the frontend where it is displayed to the user.
🚧 Challenges we ran into
- Hosting the backend server on EC2 instances with GPUs (to run the machine learning models) proved to be quite complicated—we initially ran into issues with drivers and quota limits
- Training BigBird took a substantial amount of time (5+ hours), even on four GTX 1080Ti’s
🤩 Accomplishments that we're proud of
We’re proud of creating a functional web application that identifies biased and emotionally charged statements within text, and training a functioning transformer model (BigBird) in only 24 hours. Overall, we are proud of creating a tool to help people better learn how authors use emotions to sway readers.
🎓 What we learned
- How to configure AWS EC2 to use Hugging Face with GPUs
- After running many articles through our app, we learned that emotionally charged news is incredibly prevalent
⏭️ What's next for Moonlit
In the future we plan to…
- Implement Moonlit as a browser Extension
- Optimize Moonlit to work with any language by using a multilingual language model (such as BLOOM)
- Train and implement a third model to review accuracy of information in a source text
Built With
- fastapi
- huggingface
- nextjs
- python
- pytorch
- react
- typescript

Log in or sign up for Devpost to join the conversation.