Introducing Text2Summary: Text Summarization on Android ( With TF-IDF ) | by Shubham Panchal | Towards Data Science

The internet is flooded with a huge amount of data. If we’re talking only about text data this includes online news, blogs, stories, and other information storehouses. Here’s where the Text Summarization comes into the picture. Representing textual information in a latent form that compromising the semantic meaning is the ultimate goal of text summarization models. Keeping this idea, I have developed Text2Summary, a text summarizer for Android apps.
github.com
Human-In-The-Loop Systems — All You Need To Know
Deploying TF Models on Heroku for Android Apps
Accessing App Usage History In Android
No, Kernels & Filters Are Not The Same
Deploying Pretrained TF Object Detection Models on Android
Realtime Selfie Segmentation In Android With MLKit
Grad-CAM: A Camera For Your Model’s Decision
MLP Mixer Is All You Need?
Age + Gender Estimation in Android with TensorFlow
Using FaceNet For On-Device Face Recognition With Android
Coding Feed-Forward Neural Networks in Kotlin (or Android)
Q-Learning With The Frozen Lake Environment In Android
Hyperparameter Optimization With Genetic Algorithms In Kotlin
Image Classification With TensorFlow 2.0 ( Without Keras )
Get Started With TensorFlow 2.0 and Linear Regression
Cityscape Image Segmentation With TensorFlow 2.0
4 Awesome Ways Of Loading ML Data In Google Colab
Neural Implanting With AutoEncoders and TensorFlow
Colorizing B/W Images With GANs in TensorFlow
Exploring Random Forests In Light Of Kotlin
Gaussian Naive Bayes ( for Iris Classification ) in Android
Sarcasm Detection using Word Embeddings in Android
Hands-on With Multiple Linear Regression on Android
Bayes Text Classification in Kotlin for Android without TensorFlow
How I made Skinly for Melanoma Detection in Android
Text Classification in Android with TensorFlow
Designing Decision Trees From Scratch on Android
Introducing TensorFlow Lite Android Support Library
Introducing Text2Summary: Text Summarization on Android
In this story, we discuss the need, installation, and usage of Text2Summary.
If you wish to summarize a huge text your app’s user has selected, you’ll have two options in front of you. Either to create an abstractive text summarization model or an extractive one.
You may understand the difference between the above-mentioned approaches here. For a short and crisp explanation, an abstractive model is like a person who reads the given and then writes the summary by himself. An extractive model is a person equipped only with a highlighter who highlights important sentences and makes a summary out of them.
If you’re are from a machine learning background, you may want to create an abstractive model from maybe Seq2Seq NN. If you’re not from a machine learning background, the Seq2Seq could be frightening.
Here comes Text2Summary,
Text2Summary uses an extractive model meaning it creates a summary using the sentences of the text given to it. It uses a TF-IDF algorithm to get the most meaningful sentences from a text. This algorithm is simpler than the above picture and runs efficiently on Android devices which have limited computational power (as compared to those GPU/TPU horses!).
First, we proceed to the project-level build.gradle file. Add the below JitPack repository,
allprojects {    repositories {        // Other dependencies        maven { url 'https://jitpack.io' }    }}
After noting the latest release of Text2Summary, add the dependency in your app-level build.gradle file,
dependencies {    // Other dependencies    implementation 'com.github.shubham0204:Text2Summary-Android:alpha-02'}
That’s all. We are ready to use Text2Summary!
First, obtain the text which you wish to summarize in the form of a String . Then, use the Text2Summary.summarize() method to start using the API,
var summary = Text2Summary.summarize( text , compressionRate = 0.7 )
What is the compressionRate above?
It’s a fraction of the text whose length equals the summary length. For instance, if you wish to create a 3/4 summary of the original text, use a compression rate of 0.75.
You may want to read a text from a File on the user’s storage,
val bufferedReader: BufferedReader = File( "poems.txt" ).bufferedReader()val text = bufferedReader.use{ it.readText() }val summary = Text2Summary.summarize( text , 0.7 )
You should get the most of Text2Summary from here. But wait. Did you experience the blockage of the UI thread? Did the activity stop for a while when you called Text2Summary.summarize() ?
Text2Summary needs to perform various operations which include ArrayList and Hashmap. If the text was huge, the UI thread stopped for a while. To tackle this problem, perform the text summarization using summarizeAsync(),
val callback = object : Text2Summary.SummaryCallback {    override fun onSummaryProduced(summary: String) {        // The summary is ready!    }}Text2Summary.summarizeAsync( someLongText , 0.7f , callback  )
Hyperparameter Optimization Using Keras Tuner API
Image Colorization With GANs
Chatbot using Seq2Seq LSTM models.
Neural Machine Translation (NMT) - Translating English sentences to French sentences.
Neural Machine Translation (NMT) - Translating English sentences to Marathi sentences.
Image Classification From Scratch With TensorFlow 2.0 ( Without Keras! )
Cityscape Image Segmentation with TensorFlow 2.0 ( Without Keras! ) 
Face Landmark Detection With TensorFlow
Neural Implanting With TensorFlow
If you're facing any issues with these notebooks, fill out this form describing your issue.
Tweet Classification with MLP-Mixers ( TF-Keras ) ( Story On Medium )
In this series, we'll make some of most popular architectures right from scratch.
From Paper To Keras: MobileNets With TensorFlow
From Paper To Keras: DenseNets With TensorFlow
An Android Developer too? See Resources for Machine Learning With Android.
You may find these notebooks in a number of articles on Medium.com.
Realtime Depth Estimation In Android ( GitHub )
MLKit Selfie Segmentation in Android ( GitHub )
Age + Gender Estimation in Android with TensorFlow ( GitHub )
Using FaceNet For On-Device Face Recognition With Android ( GitHub )
Text2Summary Android ( GitHub )
Q-Learning With The Frozen Lake Environment In Android ( GitHub )
Hyperparameter Optimization With Genetic Algorithms in Kotlin ( GitHub )
Exploring Random Forests In Light Of Kotlin ( GitHub )
Coding Feed-Forward Neural Networks in Kotlin (or Android) ( GitHub )
Gaussian Naive Bayes ( for Iris Classification ) in Android ( GitHub )
How I made Skinly for Melanoma Detection in Android ( GitHub )
Designing Decision Trees From Scratch on Android ( GitHub )
Text Classification in Android with TensorFlow ( GitHub )
Sarcasm Detection using Word Embeddings in Android ( GitHub )
Hands-on With Multiple Linear Regression on Android
Bayes Text Classification in Kotlin for Android without TensorFlow
Introducing TensorFlow Lite Android Support Library
I hope you liked Text2Summary. Use it in your Android app and share your problems and suggestions. Thanks!