{"id":23691166,"url":"https://github.com/sagorbrur/emailwriter","last_synced_at":"2026-02-25T23:05:41.830Z","repository":{"id":109989053,"uuid":"475038128","full_name":"sagorbrur/EmailWriter","owner":"sagorbrur","description":"Email Writer is a GPT-2 based email generator application","archived":false,"fork":false,"pushed_at":"2022-08-07T18:21:25.000Z","size":5432,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-02T20:45:47.646Z","etag":null,"topics":["flask-api","gpt-2","nlp","text-generation","transformers","webapp"],"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/sagorbrur.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-03-28T14:26:07.000Z","updated_at":"2025-03-13T13:09:45.000Z","dependencies_parsed_at":"2023-03-08T13:45:14.383Z","dependency_job_id":null,"html_url":"https://github.com/sagorbrur/EmailWriter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sagorbrur/EmailWriter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagorbrur%2FEmailWriter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagorbrur%2FEmailWriter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagorbrur%2FEmailWriter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagorbrur%2FEmailWriter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sagorbrur","download_url":"https://codeload.github.com/sagorbrur/EmailWriter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagorbrur%2FEmailWriter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29844845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"ssl_error","status_checked_at":"2026-02-25T22:37:25.960Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["flask-api","gpt-2","nlp","text-generation","transformers","webapp"],"created_at":"2024-12-30T02:55:50.685Z","updated_at":"2026-02-25T23:05:41.825Z","avatar_url":"https://github.com/sagorbrur.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Email Writer\nEmail writer is a [gpt-2](https://github.com/openai/gpt-2) based email generator application. It is a fine-tune version of [gpt-2-medium](https://huggingface.co/gpt2-medium) model which is trained on [this](https://www.kaggle.com/datasets/mikeschmidtavemac/emailblog) datasets. Model published in huggingface [model hub](https://huggingface.co/sagorsarker/emailgenerator)\n\n## API request and response schema\n```py\nrequest = {\n    \"prompt\": str,\n    \"token_count\": int,\n    \"temperature\": float,\n    \"n_gen\": int,\n    \"keywords\": list\n}\n\nresponse = {\n    \"status\": str,\n    \"ai_results\": [\n        {\n            \"generated_text\": str,\n            \"text_length\": int\n        },\n    ]\n}\n```\n\n## Installation\n### Method-1\nenvironment setup using `environment.yml` file\n```\nconda env create -f environment.yml\nconda activate email_writer_env\n```\n### Method-2\n```bash\npip install -r requirements.txt\n# install pytorch \u003e= 1.11\nconda install pytorch cudatoolkit=11.3 -c pytorch\n```\n\n## Run Application\nThis application is based one [Flask](https://flask.palletsprojects.com/en/2.1.x/) framework.\nDefault port for this application is 5000.\n\n```bash\npython app.py\n```\n\n## Test Application\nChange input `data` in `tests/test_app.py` to test different inputs.\n\n```bash\npython -m tests.test_app\n```\nor \n\n```py\nimport requests\n\ndata = {\n    \"prompt\": \"love to visit again\", # subject of the email\n    \"token_count\": 128,\n    \"temperature\": 0.6,\n    \"n_gen\": 4,\n    \"keywords\": ['experience', 'joyfull', 'sea'] # relevant keywords\n}\n\nresponse = requests.post('http://localhost:5000/generate', json=data)\nprint(response.json())\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagorbrur%2Femailwriter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsagorbrur%2Femailwriter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagorbrur%2Femailwriter/lists"}