Building quick web app to deploy ML models

I’ve almost completed my DL models for an NLP project. Now I want to make a web app.

I created models in PyTorch to detect propaganda text fragments in news articles. The models have poor performance. But given a news article, they can return offsets & labels for each offset (in a text file), identifying the type of propaganda in each span of text.

Now I want to build a prototype Web app to demo this project with following minimal requirements:

  1. User provides articles (upload text file or provide link for online blog/article)
  2. System highlights all detected fragments. On hovering over each, a tooltip displays the label (propaganda technique name classifier gives a label to each span).
  3. Display bar or pie charts to show frequency of each propaganda type in the provided articles. And the propaganda percentage found in each article. Can you please suggest a python framework with which I can build a minimal prototype in the shortest possible time? Something that I can learn in a few days. I’m thinking of trying it out on StreamLit Can anybody guide me whether Flask, StreamLit or Django will be better, coz I have a deadline & need to build a simple web app by learning any new framework.
Add Comment
1 Answer(s)

Flask and Django work very, very differently from a framework like StreamLit.

They basically allow you to integrate python functionality and "offline apps" with HTML logic to build quick web apps. They do not have any tools for building all the requirements described in 1 -3 only for rendering them on a website dynamically. The easiest way I can describe Flask is that it allows you to have your finished app interact with web pull and put requests.

Given what you describe I would therefore discourage you using Flask or Django for this, as it seems that they would only help you in the last step, the deployment and not simplify the coding of the actual app.

I do not know StreamLit well so allow me to add an alternative:

Interactive Jupyter Notebooks simply hosted online and publicly reachable

Should you already have an app that you want to simply deploy,then Flask is an easy enough way to that however.

Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.