{"id":13585213,"url":"https://github.com/wyounas/homer","last_synced_at":"2026-04-09T06:35:47.727Z","repository":{"id":46617068,"uuid":"194557282","full_name":"wyounas/homer","owner":"wyounas","description":"Homer, a text analyser in Python, can help make your text more clear, simple and useful for your readers.","archived":false,"fork":false,"pushed_at":"2025-03-17T07:08:23.000Z","size":4883,"stargazers_count":632,"open_issues_count":8,"forks_count":35,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-17T08:26:49.623Z","etag":null,"topics":["nlp","nlp-library","python","python-library","python-script","python3","text-analysis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wyounas.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-30T20:16:33.000Z","updated_at":"2025-03-17T07:08:27.000Z","dependencies_parsed_at":"2022-09-17T06:43:00.105Z","dependency_job_id":null,"html_url":"https://github.com/wyounas/homer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyounas%2Fhomer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyounas%2Fhomer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyounas%2Fhomer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyounas%2Fhomer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wyounas","download_url":"https://codeload.github.com/wyounas/homer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247607582,"owners_count":20965944,"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":["nlp","nlp-library","python","python-library","python-script","python3","text-analysis"],"created_at":"2024-08-01T15:04:48.535Z","updated_at":"2025-12-13T16:04:54.496Z","avatar_url":"https://github.com/wyounas.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"Homer\n#####\n\n\n.. image:: https://img.shields.io/badge/Made%20with-Python-1f425f.svg\n   :target: https://www.python.org/\n   :alt: Made with Python\n\n.. image:: https://img.shields.io/pypi/pyversions/homer-text\n   :target: https://pypi.org/project/homer-text/\n   :alt: Python versions\n\n.. image:: https://img.shields.io/pypi/l/homer-text\n   :target: https://pypi.org/project/homer-text/\n   :alt: Pypi licence\n\n.. image:: https://img.shields.io/github/issues-raw/wyounas/homer\n   :target: https://github.com/wyounas/homer/issues\n   :alt: Issues\n\n\n.. contents::\n\n.. section-numbering::\n\n\n\n\nHomer is a Python package that can help make your text more clear, simple and useful for the reader.\nIt provides information on an overall text as well as on individual paragraphs. It gives insights into readability, length of paragraphs, length of sentences, average sentences per paragraph, average words in a sentence, etc. It also tries to identify certain kind of vague words. It also tracks the frequency of \"and\" words in the text. (More information on all of these follows in the `Acknowledgements` section.)\n\nThis software package grew out of a personal need. Since I am not a native English speaker but am interested in writing, I designed and have been using Homer to improve my writing. I hope others will find it useful.\n\nPlease note that this is not a strict guide to control your writing. At least, I don't use it that way. I use it as a guide to make my writing as simple as possible. I strive to write concise paragraphs and sentences as well as use fewer unclear words, and Homer has been helping me.\n\nI have only used it to analyze my blogs and essays and not the large corpus of text. As this software is new, you may well spot bugs, in which case please feel free to open up issues/pull-requests.\n\nYou can use Homer as a stand-alone package or on the command line. If you run it on the command line, you can get general stats on your article or essay as well as paragraph stats.\n\nFeatures\n========\n\nArticle/Essay Stats\n-------------------\n\nRunning Homer from the command line gives the following insights about the article/essay:\n\n* Reading time in minutes (although this will vary some from reader to reader).\n* Readability scores (Flesch reading ease and Dale Chall readability scores).\n* Total paragraphs, sentences, and words.\n* Average sentences per paragraph.\n* Average words per sentence.\n* \"and\" frequency.\n* Number and list of compulsive hedgers, intensifiers, vague words.\n\n\n.. class:: no-web\n\n    .. image:: https://drive.google.com/uc?export=view\u0026id=19E7MDoMObkwGrN2FceXv9qjZLzBLBg6U\n        :alt: overall stats\n        :width: 100%\n        :align: center\n\n\nParagraph Stats\n---------------\n\nParagraph stats point out the following information for each paragraph:\n\n* Number of sentences and words.\n* Average words per sentence.\n* The longest sentence in the paragraph.\n* Readability scores (Flesch reading ease and Dale Chall readability scores).\n* If the number of sentences is more than five in a paragraph, then Homer gives a warning highlighted in red.\n* Similarly, when the number of words is more than 25 in a sentence, then a warning highlighted in red is given.\n\n.. class:: no-web\n\n    .. image:: https://drive.google.com/uc?export=view\u0026id=1tnXSEh7nWQrtO3glDbtsoD_N-Q-xt2-h\n        :alt: paragraph stats\n        :width: 100%\n        :align: center\n\n\nInstallation\n============\n\nPython\n------\n\nI built this on Python 3.4.5. So first we need to install Python.\n\nOn Mac, I used Homebrew to install Python e.g. one can use this command:\n\n.. code-block:: bash\n    $ brew install python3\n\n\nTo install on Windows, you can download the installer from `here \u003chttps://www.python.org/downloads/windows/\u003e`_. Once downloaded this installer can be run to complete Python's installation.\n\nFor Ubuntu you might find this `resource \u003chttps://askubuntu.com/questions/802279/how-to-install-python-3-4-5-from-apt\u003e`_ useful.\n\n\nVirtual environment\n-------------------\n\nNow it's time to create a virtual environment (assuming you cloned the code under `~/code/homer`).\n\n.. code-block:: bash\n    ~/code/homer $ python3 -m venv venv\n    ~/code/homer $ source venv/bin/activate\n\nFirst line in the above snippet creates a virtual environment named `venv` under `~/code/homer`. The second command activates the virtual environment.\n\nIn case you need more help with creating a virtual environment this `resource \u003chttps://docs.python.org/3/library/venv.html\u003e`_ can prove to be useful.\n\nInstalling `Homer` via Pip\n--------------------------\n\nInstall using Pip:\n\n.. code-block:: bash\n\n    ~/code/homer $ pip install homer-text\n\n\nAnd that's it. It should install everything i.e. required libraries, NLTK packages and homer_text itself.\n\n\nUsage\n=====\n\nFirst time\n-----------\nPrior to using it for the first time, make sure you have all `nltk` dictionary files:\n\n.. code-block:: python\n\n    import nltk\n    nltk.download('punkt')\n    nltk.download('cmudict')\n    nltk.download('stopwords')\n\n\nCommand line\n------------\n\nA command line utility, under the `homer` directory, has been provided. Here is an example showing how to use it:\n\n.. code-block:: bash\n\n    \u003e python homer_cmd.py --name article_name --author lalala --file_path=/correct/path/to/file.txt\n\n\nBoth `--name` and `--author` are optional whereas `file_path` is mandatory.\n\nCode\n====\n\nYou can also use Homer in your code. Here is an example:\n\n.. code-block:: python\n\n    # file: analyse.py\n    import sys\n    from homer.analyzer import Article\n    from homer.cmdline_printer import ArticlePrinter\n\n    article = Article('Article name', 'Author', open(sys.argv[1]).read())\n    ap = ArticlePrinter(article)\n    ap.print_article_stats()\n    ap.print_paragraph_stats()\n\nUse it like this:\n\n.. code-block:: bash\n\n    \u003e python analyse.py text_to_analyse.md\n\nTests\n=====\n\nTests can be run from the `tests` directory.\n\n\nUsers\n=====\n\nHomer is used in academia for research. It can be helpful to look at existing uses of Homer to learn how you can use it to design a robust\nsystem for text analysis.\n\n- **Babanejad, Nastaran, et al.** \"The role of preprocessing for word representation learning in affective tasks.\"\n  *IEEE Transactions on Affective Computing* 15.1 (2023): 254-272.\n\n- **Campanile, Lelio, et al.** \"On the Evaluation of BDD Requirements with Text-based Metrics: The ETCS-L3 Case Study.\"\n  *Intelligent Decision Technologies: Proceedings of the 14th KES-IDT 2022 Conference.* Singapore: Springer Nature Singapore, 2022.\n\n- **Dehaki, Nastaran Babanejad.** \"Enriching Word Representation Learning for Affect Detection and Affect-Aware Recommendations.\" *PhD dissertation, York University, Toronto, Ontario* (2020).\n\nIf your work uses Homer, please send a PR to add it to this list!\n\nCitation\n========\n\nIf you use Homer in academic work, please cite the following:\n\n.. code-block:: bibtex\n\n    @misc{homer2019,\n      author = {Waqas Younas},\n      title = {Homer: A Thorough Text Analyzer.},\n      year = {2019},\n      howpublished = {\\url{https://github.com/wyounas/homer}}\n    }\n\n\n\nAuthor \u0026 Contributors\n=====================\n\nAuthor:\n\n\n* `Waqas Younas \u003chttp://wyounas.github.io\u003e`_ (waqas.younas@gmail.com)\n\nContributors:\n\n\n* https://github.com/voronaam\n* https://github.com/fkarg\n\n\nAcknowledgements\n================\n\n* Steven Pinker's `The Sense of Style: The Thinking Person's Guide to Writing in the 21st Century \u003chttps://www.amazon.com/Sense-Style-Thinking-Persons-Writing/dp/0143127799\u003e`_. This book gave me quite a few insights. It also prompted me to include tracking of vague words, complex hedgers and intensifiers.\n\n  - Complex hedgers: These are words such as _apparently, almost, fairly, nearly, partially, predominantly, presumably, rather, relative, seemingly, etc._\n\n  - Intensifiers: Words such as _very, highly, extremely.\n\n* Bankspeak:\n\n    The Language of World Bank Reports, 1946–2012: https://litlab.stanford.edu/LiteraryLabPamphlet9.pdf. This source also gave me a few ideas. The idea to keep track of \"and\" and the vague words in a text was taken from here.\n\n    -  \"and\" frequency: Basically it is the number of times the word \"and\" is used in the text (given as a percentage of total text). I try to keep it under 3 %.\n\n    - Vague words is a list of words I compiled after reading the above report.  Using these words unnecessarily, or without giving them the proper context, can make a text more abstract. These are words such as _derivative, fair value, portfolio, evaluation, strategy, competitiveness, reform, growth, capacity, progress, stability, protection, access, sustainable, etc._\n\n\nContributing\n============\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate. Also, add your name under `Authors` section of the `readme` file.\n\n\nLicense\n=======\n`MIT \u003chttps://choosealicense.com/licenses/mit/\u003e`_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyounas%2Fhomer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwyounas%2Fhomer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyounas%2Fhomer/lists"}