Using Flask as an API and web application
In Chapter 9, Natural Language Processing, we explored the use of the transformers
library for the purposes of running text similarity search engines. By using this technology, we could have explored other models and implementations, such as sentiment analysis, text classification, and many more. One particular type of model that has gained a great deal of traction when it comes to NLP is the summarization model.
We can think of summarization models as tasks designed to reduce several paragraphs of text down to a few sentences, thereby allowing users to reduce the amount of time required to read. Luckily for us, we can implement an out-of-the-box summarization model using the transformers
library and install that in our app.py
file. Not only will we need to cater to human users (by using a UI), but we will also need to cater to web applications (APIs) that may be interested in using our model. In order to accommodate these two cases, we...