Hack days and GraphQL

3 minute read

Nowadays, it is common in many startups to have playground events for engineers to encourage team building, creativity and sometimes even bring ideas that end up changing the company’s product. I am a true believer of this process and today I will explain two examples of projects I developed in this context, to the extent I am allowed due to confidentiality, NDAs, etc.

Labello

My first experience with this was in my firt company in London, Eigen Technologies. There we had one friday a month to do whatever pet project we wanted, always related to our job. One of the projects I did in Hackdays was in turn my first chance to experiment with frontend and learn a bit of ReactJS and Javascript. We had a very simple annotation tool to build data for NLP models called Labello. This was useful to tag sentences in documents answering a number of questions that we wanted to create models for.

My idea here was to introduce active learning concepts. While what I will explain was very simple, nowadays there are sophisticated and very well-written tools to do this, e.g. Prodigy from SpaCy. It is surprising how, after labelling some examples, even a poor model trained with 10 examples can sometimes direct you to the page/portion containing an answer to a question. This is true especially for easy/repetitive questions, and especially useful for very long documents. With such an assistant, we can increase labelling speed, and reinforce model predictions, such that eventually we can tell to the user that we have enough data, and no more labelling is needed.

While I did not stay enough in the company to see it in production, I did spend some weeks discussing with engineers (the real ones 😁, aka software engineers ) and designers, and even did some prototyping in my "real working hours". Hence, this is one of those success stories where a Hack project reaches a happy ending.

Live AI feedback

On the other end, my last experience in a Hackathon was in my current company, Globality. At Globality, the Hackahton is celebrated once a year for a couple of days, with an internal competition, with prizes, a final, podium, etc. This year we were fortunate to receive a lot of appreciation from the jury and in general from many people in the company, and we WON! I have to say that not without a ton of work and learning.

Our proposal was to add an assistant to help the user while answering a question. This would show the AI predictions in real time (hence the name of the project), so that she could understand the implications of her answer to model's understanding. Our main objective was to make the user reflect based on this, and potentially improve the answer focusing on the important details, or extending them.

As I explained above, we received a lot of attention, and even had a meeting with the leadership team (C and VP levels) to discuss next steps. As of writing, we are on discussions to iterate on the idea and build a roadmap for implementation. By the way, I don't want to lose this opportunity to give credit to my "co-founder" for this Hackathon project: Tomasz Pietruszka.

GraphQL

To implement what I briefly (too brief, I know 🤷‍♂️) explained above, we had to touch many different pieces. As many platforms nowadays, ours follows a micro-service architecture organized in several layers: frontend, gateway, and backend. As the name suggests, the gateway allows to communicate frontend with backend.

While we usually work in the backend, for the Hackathon we had a frontend engineer but no software engineeer. Hence, we had to do some changes to the gateway. In our case, this is written in GraphQL, a somewhat new (2018) open-source technology developed originally by Facebook. To put in context, GraphQL is an alternative to REST APIs. The main selling point is that rather than query using GET/POST limited to what the backend decided to implement in their endpoints, here we have some more flexibility in what data we want the server to return, by sending a query with the fields of interest.

I will not give a full introduction about GraphQL, as there are many good resources online. Rather, I will link the interested reader to this Github repository, that I wrote to practice what I learned. See the README in there for links to learning resources.

Conclusion

Don't hesitate to ask me if you have questions. Have a wonderful day!