{"id":25126164,"url":"https://github.com/cmry/topbox","last_synced_at":"2025-04-02T18:43:03.898Z","repository":{"id":34133867,"uuid":"37966559","full_name":"cmry/topbox","owner":"cmry","description":"Python 3 wrapper around the Stanford Topic Modeling Toolbox","archived":false,"fork":false,"pushed_at":"2017-01-10T09:43:44.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T09:19:19.217Z","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":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmry.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-06-24T06:25:46.000Z","updated_at":"2019-06-17T11:48:26.000Z","dependencies_parsed_at":"2022-08-18T01:20:08.781Z","dependency_job_id":null,"html_url":"https://github.com/cmry/topbox","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/cmry%2Ftopbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmry%2Ftopbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmry%2Ftopbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmry%2Ftopbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmry","download_url":"https://codeload.github.com/cmry/topbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246871287,"owners_count":20847457,"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-02-08T09:19:20.032Z","updated_at":"2025-04-02T18:43:03.879Z","avatar_url":"https://github.com/cmry.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# topbox\nA small Python 3 wrapper around the Stanford Topic Modeling Toolbox (STMT) that makes working with L-LDA a bit easier; no need to leave the Python environment. More information on its workings can be found on [my blog](https://cmry.github.io/notes/topbox).\n\n# Setting up\n\nJust [download](http://nlp.stanford.edu/software/tmt/tmt-0.4/tmt-0.4.0.jar) STMT and put it in the `box` directory. After, import `topbox` from wherever you left it.\n\nOn Linux, this would look something like this:\n\n``` shell\n$ cd ~\n$ git clone https://github.com/cmry/topbox\n$ cd ~/topbox/box\n$ wget http://nlp.stanford.edu/software/tmt/tmt-0.4/tmt-0.4.0.jar\n$ cd ~\n$ vi some_topbox_script.py\n```\n\nYou can paste the code below in the script file to test if it's working.\n\n# Example\n\n``` python\nimport topbox\n\nstmt = topbox.STMT('bit_of_testing', epochs=10, mem=15000)\n\n\nspace = ['text text more text', 'things to do with text']\nlabels = ['label1 label2', 'label1 label3']\n\nstmt.train(space, labels)\n\n\ninfer = ['this is a text', 'things with more text']\ngs = ['label1 label2', 'label1 label3']\n\nstmt.test(infer, gs)\n\n\nfrom sklearn.metrics import average_precision_score\n\n# array requires numpy and scipy\ny_true, y_score = stmt.results(gs, array=True)\n\nprint(average_precision_score(y_true, y_score))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmry%2Ftopbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmry%2Ftopbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmry%2Ftopbox/lists"}