{"id":20735084,"url":"https://github.com/kool-cool/paraphrasing-tool","last_synced_at":"2025-12-26T03:28:06.582Z","repository":{"id":168897500,"uuid":"644713337","full_name":"Kool-Cool/Paraphrasing-Tool","owner":"Kool-Cool","description":"This is paragraphing tool using transformers. ","archived":false,"fork":false,"pushed_at":"2023-07-20T08:01:56.000Z","size":1130,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T00:52:02.199Z","etag":null,"topics":["machine-learning","nlp","nlp-machine-learning","paraphrase","paraphrase-generation","python","transformer"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kool-Cool.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-24T05:26:16.000Z","updated_at":"2024-06-04T14:44:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"2d28b21f-9255-43ea-8a7f-d45cd5d2a7f8","html_url":"https://github.com/Kool-Cool/Paraphrasing-Tool","commit_stats":null,"previous_names":["kool-cool/paraphrasing-tool"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kool-Cool%2FParaphrasing-Tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kool-Cool%2FParaphrasing-Tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kool-Cool%2FParaphrasing-Tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kool-Cool%2FParaphrasing-Tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kool-Cool","download_url":"https://codeload.github.com/Kool-Cool/Paraphrasing-Tool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243020690,"owners_count":20223058,"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":["machine-learning","nlp","nlp-machine-learning","paraphrase","paraphrase-generation","python","transformer"],"created_at":"2024-11-17T05:34:18.706Z","updated_at":"2025-12-26T03:28:06.547Z","avatar_url":"https://github.com/Kool-Cool.png","language":"Jupyter Notebook","readme":"# Pegasus Text Paraphrasing Documentation\n\nThe Pegasus model is a powerful tool for text paraphrasing, capable of generating multiple paraphrases for a given input sentence. This documentation provides a guide on how to use the Pegasus model for text paraphrasing and lists the required dependencies.\n\n## Table of Contents\n\n1. [Introduction](#introduction)\n2. [Requirements](#requirements)\n3. [Installation](#installation)\n4. [Usage](#usage)\n5. [Conclusion](#conclusion)\n\n## 1. Introduction\n\nPegasus is a state-of-the-art pre-trained model designed for paraphrasing tasks. It leverages the power of deep learning and attention mechanisms to produce high-quality paraphrases for various input sentences. By generating multiple paraphrases, Pegasus provides users with diverse options for text transformation.\n\n## 2. Requirements\n\nTo use the Pegasus model for text paraphrasing, the following dependencies are required:\n\n- absl-py\n- mock\n- numpy\n- rouge-score\n- sacrebleu\n- sentencepiece\n- tensorflow-text==1.15.0rc0\n- tensor2tensor==1.15.0\n- tensorflow-datasets==2.1.0\n- tensorflow-gpu==1.15.2\n- sentence-splitter (Install using pip: `pip install sentence-splitter`)\n- transformers (Install using pip: `pip install transformers`)\n- SentencePiece (Install using pip: `pip install SentencePiece`)\n\n## 3. Installation\n\nTo get started, first install all the required dependencies listed in the previous section.\n\n## 4. Usage\n\nTo use the Pegasus model for paraphrasing, you can use the provided Python code. The code makes use of the Pegasus model and tokenizer from the `transformers` library.\n\n```python\nimport torch\nfrom transformers import PegasusForConditionalGeneration, PegasusTokenizer\n\n# Load the pre-trained model and tokenizer\nmodel_name = 'tuner007/pegasus_paraphrase'\ntorch_device = 'cuda' if torch.cuda.is_available() else 'cpu'\n\ntokenizer = PegasusTokenizer.from_pretrained(model_name)\nmodel = PegasusForConditionalGeneration.from_pretrained(model_name).to(torch_device)\n\ndef get_response(input_text, num_return_sequences):\n    batch = tokenizer.prepare_seq2seq_batch([input_text],\n                                            truncation=True,\n                                            padding='longest',\n                                            max_length=60, return_tensors=\"pt\").to(torch_device)\n\n    translated = model.generate(**batch, max_length=60,\n                                num_beams=10, \n                                num_return_sequences=num_return_sequences, \n                                temperature=1.5)\n\n    tgt_text = tokenizer.batch_decode(translated, skip_special_tokens=True)\n\n    return tgt_text\n```\n\n\n## 5. Conclusion\nWith the Pegasus model, you can easily perform text paraphrasing and explore various alternatives for a given sentence. Enjoy the flexibility and versatility of Pegasus in transforming your text data\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkool-cool%2Fparaphrasing-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkool-cool%2Fparaphrasing-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkool-cool%2Fparaphrasing-tool/lists"}