{"id":26933152,"url":"https://github.com/xiaohan2012/chowmein","last_synced_at":"2025-06-22T03:40:24.911Z","repository":{"id":35892331,"uuid":"40178686","full_name":"xiaohan2012/chowmein","owner":"xiaohan2012","description":"Automatic labeling for topic model","archived":false,"fork":false,"pushed_at":"2015-08-09T20:24:14.000Z","size":5956,"stargazers_count":57,"open_issues_count":1,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-14T18:06:58.034Z","etag":null,"topics":[],"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/xiaohan2012.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}},"created_at":"2015-08-04T10:34:25.000Z","updated_at":"2024-02-29T04:48:30.000Z","dependencies_parsed_at":"2022-09-08T17:31:43.892Z","dependency_job_id":null,"html_url":"https://github.com/xiaohan2012/chowmein","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/xiaohan2012%2Fchowmein","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaohan2012%2Fchowmein/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaohan2012%2Fchowmein/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaohan2012%2Fchowmein/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiaohan2012","download_url":"https://codeload.github.com/xiaohan2012/chowmein/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246785479,"owners_count":20833498,"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":[],"created_at":"2025-04-02T09:17:40.138Z","updated_at":"2025-04-02T09:17:40.666Z","avatar_url":"https://github.com/xiaohan2012.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/xiaohan2012/chowmein.svg?branch=master)](https://travis-ci.org/xiaohan2012/chowmein)\n[![Coverage Status](https://coveralls.io/repos/xiaohan2012/chowmein/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/xiaohan2012/chowmein?branch=master)\n\n# chowmein\n\nAutomatic labeling of topic models.\n\nThe alogirithm is described in [Automatic Labeling of Multinomial Topic Models](http://sifaka.cs.uiuc.edu/czhai/pub/kdd07-label.pdf)\n\n# Example \n\nWe model the abstracts of `NIPS 2014`(NIPS abstracts from 2008 to 2014 is available under `datasets/`).\nMeanwhile, we contrain the labels to be tagged as `NN,NN` or `JJ,NN` and use the top 200 most informative labels.\n\n\n```\n\u003e\u003e\u003e python label_topic.py --line_corpus_path datasets/nips-2014.dat --preprocessing wordlen tag --label_tags NN,NN JJ,NN --n_cand_labels 200\n...\nTopical words:\n--------------------\nTopic 0: model data framework clustering information distributions two number world propose noise real work small\nTopic 1: learning algorithm time problem online regret information decision conditional new stochastic algorithms selection problems\nTopic 2: algorithm algorithms problem results learning optimal show function class functions graph bounds based general\nTopic 3: learning training networks data tasks features neural kernel performance classification model datasets feature deep\nTopic 4: matrix method sparse convex problems methods dimensional problem rank analysis propose regression norm gradient\nTopic 5: model models inference approach data linear based gaussian method methods process sampling structure time\n\nTopical labels:\n--------------------\nTopic labels:\nTopic 0: neural population, inference algorithm, likelihood estimator, stochastic optimization, matrix recovery, paper develop, empirical study, covariance matrix\nTopic 1: bandit problem, near-optimal regret, function approximation, paper consider, general class, multi-armed bandit, value function, statistical learning\nTopic 2: logarithmic factor, statistical learning, convergence rate, communication cost, other hand, main result, solution quality, function approximation\nTopic 3: pascal voc, major challenge, natural language, paper introduce, object recognition, policy search, empirical study, classification accuracy\nTopic 4: low-rank tensor, low-rank matrix, matrix recovery, coordinate descent, problem finding, direction method, statistical learning, risk minimization\nTopic 5: inference algorithm, introduce novel, exponential family, probabilistic inference, neural population, value function, policy search, other hand\n```\n\n# Usage\n\n\n## Command line\n\nFor example:\n\n    \u003e\u003e\u003e python label_topic.py --line_corpus_path datasets/nips-2014.dat  --preprocess wordlen tag --label_tags NN,NN\n\nFor more details:\n\n    \u003e\u003e\u003e python label_topic.py --help\n\n## Programmatically\n\nPlease refer to `label_topic.py`.\n\n\n# How it works\n\nThe current version goes through the following steps\n\n1. Preprocessing using [nltk](http://www.nltk.org/)'s `word_tokenize`, `stem` and `pos_tag`.\n1. Candidate phrase detection using *pointwise mutual information*: POS tag constraint can be applied. For now, only **bigrams** are considered.\n2. Topic modeling using [LDA](https://pypi.python.org/pypi/lda).\n3. Candidate label ranking using the algorithm [here](http://sifaka.cs.uiuc.edu/czhai/pub/kdd07-label.pdf).\n\n\n# TODO\n\n\n- Better phrase detection thorugh better POS tagging\n- Better ways to compute language models for labels to support `intra topical coverage` heuristic(which is now **disabled**)\n- Support for user defined candidate labels\n- Faster PMI computation(using Cythong for example)\n- More flexibity/option on preprocessing\n- Leveraging knowledge base to refine the labels\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaohan2012%2Fchowmein","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaohan2012%2Fchowmein","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaohan2012%2Fchowmein/lists"}