{"id":15698336,"url":"https://github.com/capjamesg/pysurprisal","last_synced_at":"2025-05-09T01:15:21.993Z","repository":{"id":173398229,"uuid":"650554561","full_name":"capjamesg/pysurprisal","owner":"capjamesg","description":"Calculate surprisal for words in text.","archived":false,"fork":false,"pushed_at":"2023-12-15T12:25:27.000Z","size":581,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-09T01:15:15.696Z","etag":null,"topics":["nlp","surprisal"],"latest_commit_sha":null,"homepage":"https://capjamesg.github.com/pysurprial/","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/capjamesg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-06-07T10:10:19.000Z","updated_at":"2024-10-12T05:45:19.000Z","dependencies_parsed_at":"2023-12-15T13:38:34.882Z","dependency_job_id":"7db2f8c1-3045-4fb4-84b0-82c55b80b79b","html_url":"https://github.com/capjamesg/pysurprisal","commit_stats":null,"previous_names":["capjamesg/pysurprisal"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fpysurprisal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fpysurprisal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fpysurprisal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fpysurprisal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capjamesg","download_url":"https://codeload.github.com/capjamesg/pysurprisal/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253171272,"owners_count":21865297,"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","surprisal"],"created_at":"2024-10-03T19:25:57.375Z","updated_at":"2025-05-09T01:15:21.970Z","avatar_url":"https://github.com/capjamesg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pysurprisal\n\n[![version](https://badge.fury.io/py/pysurprisal.svg)](https://badge.fury.io/py/pysurprisal)\n[![downloads](https://img.shields.io/pypi/dm/pysurprisal)](https://pypistats.org/packages/pysurprisal)\n[![license](https://img.shields.io/pypi/l/pysurprisal)](https://github.com/capjamesg/pysurprisal/blob/main/LICENSE)\n[![python-version](https://img.shields.io/pypi/pyversions/pysurprisal)](https://badge.fury.io/py/pysurprisal)\n\nAn implementation of surprisal in Python.\n\n## Installation\n\n```bash\npip install pysurprisal\n```\n\n## Usage\n\n```python\nfrom pysurprisal import Surprisal\n\ntext = \"...\"\n\n# calculate surprisal for each word in the text\ndata = Surprisal(text)\nsurprisals = data.calculate_surprisals()\n\n# get the top 10 most surprising words\ntop_k = data.get_top_k(10)\n\n# print dictionary of all surprisals\n# key = word, value = surprisal\nprint(surprisals.surprisals)\n```\n\n## Contributors\n\n- capjamesg\n\n## License\n\nThis project is licensed under an [MIT license](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapjamesg%2Fpysurprisal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapjamesg%2Fpysurprisal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapjamesg%2Fpysurprisal/lists"}