# Buycott — from a barcode to company news

By Arya Garg

Canonical source: https://aryagarg23.com/writing/buycott

Archive date: 2023-11 (historical site date; not a verified publication date)

Register: Technical

Tags: HACK

Section: [Hackathons](https://aryagarg23.com/about#hackathons)

## Main

Buycott started with a reel Kaaustaaub Shankar had seen about the war, where somebody was trying to boycott companies connected to it. We ended up talking about perception. The same information doesn't mean the same thing to everybody. Your past experience and your values change how you read it. Even if two people agree on the facts, they can make different decisions from them.

So I didn't want the app to be a moral traffic light. A barcode scanner that says BUY or DON'T BUY is fast, but the software is quietly making the most important decision for you.

We wanted to do something narrower. The app would scan the barcode, work out which parent company is behind the product, find the reporting about that company, and cut it down enough that somebody standing in an aisle could get the top line. The judgment stayed with them.

I don't think you need a huge amount of information to make a purchase decision. You need the right amount for the decision you're making.

Kaaustaaub, Ary Sharma, Aniruddhan Ramesh and I built the prototype at MakeUC.

[Interactive figure: Product owners]

## Technical

| Buycott flow |
| --- |
| Barcode |
| ↓ |
| Product identification |
| ↓ |
| Parent-company resolution |
| ↓ |
| GDELT news queries |
| ↓ |
| Entity extraction / mapping |
| ↓ |
| RoBERTa stance + sentiment outputs |
| ↓ |
| Headline structure rules (subject → action → attributed entity) |
| ↓ |
| Grouped article clusters |
| ↓ |
| Flutter mobile interface |

![From barcode to sourced stance card, the pipeline as built](https://aryagarg23.com/figures/buycott/pipeline.png)

The barcode-to-product path used Google Vision tooling. Product information was resolved to a parent company before the news lookup. GDELT supplied company-related reporting, and a scheduled pull kept tagged coverage available.

The NLP layer combined entity mapping with sentiment processing and a RoBERTa classifier trained for article stance on the war. Sentiment alone couldn't tell us the company's role in the event being reported. A company criticising an action and a company being criticised for that action can both show up in strongly negative language. So the extra processing used headline structure: subject, action, and attributed entity.

The processed articles were grouped into company-level views, with the source articles still attached. The client was built in Flutter. Flask handled the backend/API layer, and the model/backend services were deployed through Google Cloud.[^buycott-technical-1][^buycott-technical-2]

[^buycott-technical-1]: [Buycott — Devpost](https://devpost.com/software/buycott)

[^buycott-technical-2]: [Original repository](https://github.com/Aryagarg23/Buycott)

## Personal

We won first overall. We also won Best Social Issues Hack, Best Use of Google Cloud, and the Wolfram award. Apparently the project annoyed some people too.

![Discord user complains about dominant team](https://aryagarg23.com/figures/buycott/the_complaint.png)

My draw to hackathons was never really the prizes. I liked that nobody handed us a problem statement. You got a weekend and a theme and had to decide for yourself what was worth building.
