{"id":21458095,"url":"https://github.com/shubham0204/text2summary-android","last_synced_at":"2025-10-05T07:31:28.207Z","repository":{"id":107553538,"uuid":"255777901","full_name":"shubham0204/Text2Summary-Android","owner":"shubham0204","description":"A library for Text Summarization on Android applications.","archived":false,"fork":false,"pushed_at":"2023-11-07T04:47:04.000Z","size":10095,"stargazers_count":26,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T14:47:18.112Z","etag":null,"topics":["android","android-development","android-library","kotlin","kotlin-android","kotlin-library","text-processing","text-summarization","tf-idf-algorithm"],"latest_commit_sha":null,"homepage":"https://medium.com/@equipintelligence/introducing-text2summary-text-summarization-on-android-674b62419019","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shubham0204.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-04-15T02:01:00.000Z","updated_at":"2024-11-12T12:58:51.000Z","dependencies_parsed_at":"2023-11-07T06:06:59.400Z","dependency_job_id":null,"html_url":"https://github.com/shubham0204/Text2Summary-Android","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubham0204%2FText2Summary-Android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubham0204%2FText2Summary-Android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubham0204%2FText2Summary-Android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubham0204%2FText2Summary-Android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shubham0204","download_url":"https://codeload.github.com/shubham0204/Text2Summary-Android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235374599,"owners_count":18979734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-development","android-library","kotlin","kotlin-android","kotlin-library","text-processing","text-summarization","tf-idf-algorithm"],"created_at":"2024-11-23T06:17:42.116Z","updated_at":"2025-10-05T07:31:28.202Z","avatar_url":"https://github.com/shubham0204.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\r\n# Text2Summary - Text Summarization with TFIDF in Kotlin\r\n\r\n![](text2summary_banner.png)\r\n\r\n[![](https://jitpack.io/v/shubham0204/Text2Summary-Android.svg)](https://jitpack.io/#shubham0204/Text2Summary-Android)\r\n\r\n[![forthebadge](https://forthebadge.com/images/badges/built-for-android.svg)](https://forthebadge.com)\r\n\r\nText2Summary API uses on-device methods to perform text summarization on Android applications. It uses extractive text summarization \r\nto give you the most important sentences from a given text.\r\n\r\nYou may [read the story of Text2Summary on Medium](https://medium.com/@equipintelligence/introducing-text2summary-text-summarization-on-android-674b62419019).\r\n\r\n* [Installation](#installation)\r\n* [Usage](#usage)\r\n* [More on Text2Summary](#more-on-text2summary)\r\n* [Contribute](#contribute)\r\n\r\n\r\n## Installation\r\n\r\nFor the latest fat JAR, see [Releases](https://github.com/shubham0204/Text2Summary-Android/releases).\r\n\r\n## Usage\r\n\r\nThe text which needs to be summarized has to be a `String` object. Then,\r\nuse `Text2Summary.summarize()` method to generate the summary.\r\n\r\n`Text2Summary.summarize()` is a suspend function and hence it should be called within a `CoroutineContext`.\r\n\r\n```kotlin\r\n\r\nrunBlocking {\r\n    var summary = Text2Summary.summarize(someLongText, compressionRate = 0.7)\r\n}\r\n```\r\nThe number `0.7` is referred as the compression factor. Meaning, given a text of 10 sentences, a summary of 7 sentences will be\r\nproduced. This number must lie in the interval `( 0 , 1 )`.\r\n\r\nYou may extract text from a file and then pass it to Text2Summary,\r\n\r\n```kotlin\r\n\r\nval bufferedReader: BufferedReader = File( \"poems.txt\" ).bufferedReader()\r\nval text = bufferedReader.use{ it.readText() }\r\nval summary = Text2Summary.summarize( text , 0.7 )\r\n\r\n```\r\n\r\nThe `summarizeAsync()` method internally calls the `summarize()` method itself wrapped in a `AsyncTask`.\r\n\r\n## More on Text2Summary\r\n\r\nText2Summary uses the TF-IDF algorithm for extractive text summarization. Note, this is not abstractive text summarization which\r\nuse neural networks like the Seq2Seq model. As TensorFlow Lite does not support fully the conversion of `Embedding` and `LSTM`\r\nlayers, we need to use the TF-IDF algorithm.\r\n\r\n1. The `text` which is given to `TextSummary.summarize()` is broken down into sentences. These sentences are further brought down\r\nto words ( tokens ).\r\n2. Using TF-IDF algorithm, a TF-IDF score is calculated for each word.\r\n3. Next, we take the sum of such scores for all words present in the sentence.\r\n4. Finally, we take the top N highest scores. The corresponding sentences hold most of the information present in the text. These\r\nsentences are then concatenated and returned as the summary.\r\n\r\n## Contribute\r\n\r\nIf you are facing any issues, [open an issue](https://github.com/shubham0204/Text2Summary/issues) on the repository.\r\n\r\n\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubham0204%2Ftext2summary-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshubham0204%2Ftext2summary-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubham0204%2Ftext2summary-android/lists"}