{"id":21905039,"url":"https://github.com/textcorpuslabs/vlngramcounter","last_synced_at":"2025-03-22T07:14:53.582Z","repository":{"id":174805653,"uuid":"582599285","full_name":"TextCorpusLabs/VLNGramCounter","owner":"TextCorpusLabs","description":"NGram counter for large datasets","archived":false,"fork":false,"pushed_at":"2023-01-20T13:38:30.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-27T07:27:30.171Z","etag":null,"topics":["ngrams","python"],"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/TextCorpusLabs.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-27T10:22:25.000Z","updated_at":"2023-01-11T11:39:13.000Z","dependencies_parsed_at":"2023-07-14T06:30:11.090Z","dependency_job_id":null,"html_url":"https://github.com/TextCorpusLabs/VLNGramCounter","commit_stats":null,"previous_names":["textcorpuslabs/vlngramcounter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TextCorpusLabs%2FVLNGramCounter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TextCorpusLabs%2FVLNGramCounter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TextCorpusLabs%2FVLNGramCounter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TextCorpusLabs%2FVLNGramCounter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TextCorpusLabs","download_url":"https://codeload.github.com/TextCorpusLabs/VLNGramCounter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244918710,"owners_count":20531686,"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":["ngrams","python"],"created_at":"2024-11-28T16:20:23.923Z","updated_at":"2025-03-22T07:14:53.563Z","avatar_url":"https://github.com/TextCorpusLabs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Very Large NGram Counter\n\n![Python](https://img.shields.io/badge/python-3.x-blue.svg)\n![MIT license](https://img.shields.io/badge/License-MIT-green.svg)\n![Last Updated](https://img.shields.io/badge/Last%20Updated-2023.01.20-success.svg)\n\nNGram counter for large corpuses\n\n# Operation\n\n## Install\n\nYou can install the package using the following steps:\n\n`pip` install using an _admin_ prompt.\n\n```{ps1}\npip uninstall VLNGramCounter -y\npython -OO -m pip install -v git+https://github.com/TextCorpusLabs/VLNGramCounter.git\n```\n\nor if you have the code local\n\n```{ps1}\npip uninstall VLNGramCounter -y\npython -OO -m pip install -v c:/repos/TextCorpusLabs/VLNGramCounter\n```\n\n## Run\n\nCounts the n-grams contained in a folder of TXT files.\n\n```{ps1}\nVLNGramCounter -source d:/data/corpus -dest d:/data/corpus.ngrams.csv\n```\n\nThe following are required parameters:\n\n* `source` is the folder containing the TXT files.\n* `dest` is the CSV file used to store the ngram results.\n\nThe following are optional parameters:\n\n* `length` is the length of the n-gram.\n  The default is 1.\n* `chunk_size` is the amount of items in used by the control structure before chunking.\n  Higher values use more ram, but compute the overall value faster.\n  The default is 1M.\n* `include` count only values in this CSV list.\n  The default is count everything.\n* `exclude` ignore values in this CSV list.\n  The default is exclude nothing.\n  **Note**: due to the order of operations, it only makes seance to `exclude` single tokens.\n* `cutoff` is the minimum value count to keep.\n  The default is 2.\n* `top` is the number of n-grams to save.\n  The default is to keep 10K.\n* `keep_case` (flag) keeps the casing as-is before converting to tokens for counting.\n  The default is to upper case everything.\n* `keep_punct` (flag) keeps all punctuation as-is before converting to tokens for counting.\n  The default is to remove all tokens that are only punctuation.\n\n**NOTE**: The order of operations for complex counting is as follows:\n\n1. Transformation (`keep_case`)\n2. Exclusion (`keep_punct` \u003e `exclude`)\n3. Inclusion (`include`)\n4. Filter (`cutoff` \u003e `top`)\n\n## Debug/Test\n\nThe code in this repo is setup as a module.\n[Debugging](https://code.visualstudio.com/docs/python/debugging#_module) and [testing](https://code.visualstudio.com/docs/python/testing) are based on the assumption that the module is already installed.\nIn order to debug (F5) or run the tests (Ctrl + ; Crtl + A), make sure to install the module as editable (see below).\n\n```{ps1}\npip uninstall VLNGramCounter -y\npython -m pip install -e c:/repos/TextCorpusLabs/VLNGramCounter\n```\n\nWhen debugging in VSCode for the first time, consider adding the below config to the _launch.json_ file.\n\n```{json}\n\"args\" : [\n    \"-source\", \"d:/data/corpus\",\n    \"-dest\", \"d:/data/corpus.ngrams.csv\",\n    \"-length\", \"1\"]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftextcorpuslabs%2Fvlngramcounter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftextcorpuslabs%2Fvlngramcounter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftextcorpuslabs%2Fvlngramcounter/lists"}