Inspiration

The rise in antisemitism, and even all forms of hate speech recently has been extremely alarming. Mainly, social media has become a cauldron for not just blatant antisemitism, but nuanced hate speech. This inspired me to build BlueSquareAI because there needs to be a program that can take in text from social media and perform sentiment analysis to hopefully figure out if it is nuanced antisemitism. That is where BlueSquareAI comes in

What it does

Blue Square AI takes in inputted text, uses the gpt-4o llm to extract the claim from the text without making any forms of judgement. Next, the context of that claim will be studied with our RAG system. The claim separately goes through our counterfactual check where we use the gpt-4o lllm to see if the same claim can be made by taking out the personal identifiers within the text. Finally, all of those steps are brought together in our scoring with each of those factors being used as score multipliers. The final score interpretation is below:

    if risk_score > 0.6:
        verdict = "High-risk trope-based rhetoric"
    elif risk_score > 0.3:
        verdict = "Ambiguous — requires context"
    else:
        verdict = "Low-risk / non-identity-based"

How I built it

I built the program using Python, LangChain, LlamaIndex, and the OpenRouter api calls to the gpt-4o model. A lot of the technologies including the pipeline and RAG system were new to me coming into this hackathon. I used ChatGPT and Cursor to help me understand these technologies and help with the layout of the program. Also big thanks to Sachin and Henry from Marshall Wace for their amazing workshop on these technologies. It really helped me understand how they worked and was crucial to the completion of my project.

Built With

  • ipynb
  • langchain
  • llamaindex
  • openai
  • python
  • rag
Share this project:

Updates