{"id":24558043,"url":"https://github.com/rse/stanford-postagger","last_synced_at":"2025-04-19T09:58:47.362Z","repository":{"id":57369403,"uuid":"133187759","full_name":"rse/stanford-postagger","owner":"rse","description":"Stanford Log-linear Part-Of-Speech (PoS) Tagger for Node.js","archived":false,"fork":false,"pushed_at":"2021-01-09T10:52:02.000Z","size":25,"stargazers_count":8,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T21:55:49.648Z","etag":null,"topics":["nlp","part-of-speech","pos","stanford","tagger"],"latest_commit_sha":null,"homepage":"http://npmjs.com/stanford-postagger","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-12T22:26:32.000Z","updated_at":"2021-12-22T09:48:31.000Z","dependencies_parsed_at":"2022-08-26T04:31:53.061Z","dependency_job_id":null,"html_url":"https://github.com/rse/stanford-postagger","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fstanford-postagger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fstanford-postagger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fstanford-postagger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fstanford-postagger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rse","download_url":"https://codeload.github.com/rse/stanford-postagger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249670020,"owners_count":21308669,"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","part-of-speech","pos","stanford","tagger"],"created_at":"2025-01-23T05:47:15.212Z","updated_at":"2025-04-19T09:58:47.343Z","avatar_url":"https://github.com/rse.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nStanford-PoSTagger\n==================\n\n[Stanford Log-Linear Part-Of-Speech (PoS) Tagger](https://nlp.stanford.edu/software/tagger.shtml) for Node.js\n\n\u003cp/\u003e\n\u003cimg src=\"https://nodei.co/npm/stanford-postagger.png?downloads=true\u0026stars=true\" alt=\"\"/\u003e\n\n\u003cp/\u003e\n\u003cimg src=\"https://david-dm.org/rse/stanford-postagger.png\" alt=\"\"/\u003e\n\nAbout\n-----\n\nThis is a small JavaScript library for use in Node.js environments,\nproviding the possibility to run the\n[Stanford Log-Linear Part-Of-Speech (PoS) Tagger](https://nlp.stanford.edu/software/tagger.shtml)\nas a local background process and query it with a frontend JavaScript API.\nUse this for tagging the words of English, German, French, Spanish, Arabic and Chinese\ntexts with PoS tags such as noun, verb, adjective, etc.\n\nNOTICE\n------\n\nThe Stanford PoS-Tagger is written in [Java](https://java.com/)\nand hence this Node.js modules requires an installed `java`\nexecutable in the environment. Additionally, notice that the\nStanford PoS-Tagger is licensed under [GNU General Public\nLicense](https://www.gnu.org/licenses/gpl-2.0.html) and is not part\nof this module. It is 128 MB in size and ships with 21 models. It is automatically downloaded from\nits external origin on `npm install`. Applications using this Node.js\nmodule have to take the license of Stanford PoS-Tagger into account.\nThe module [pos](https://npmjs.com/pos) (LGPL licensed, English only),\nthe module [en-pos](https://npmjs.com/en-pos) (MIT licensed, English only),\nthe module [wink-pos-tagger](https://npmjs.com/wink-pos-tagger) (AGPL licensed, English only),\nthe module [compromise](http://compromise.cool) (MIT licensed, English only),\nand the module [kompromiss](https://npmjs.com/kompromiss) (MIT licensed, German only)\nare decent alternatives if less accuracy and smaller language support are acceptable.\n\nModels\n------\n\nThis package includes the following upstream Stanford PoS-Tagger models:\n\nModel Id                                | Language | PoS Tags             | Alias Id\n----------------------------------------|----------|----------------------|----------\n`english-left3words-distsim`            | English  | Penn Treebank        | `english`\n`english-caseless-left3words-distsim`   | English  | Penn Treebank        |\n`english-bidirectional-distsim`         | English  | Penn Treebank        |\n`wsj-0-18-left3words-distsim`           | English  | Penn Treebank        | `english-alt`\n`wsj-0-18-left3words-nodistsim`         | English  | Penn Treebank        |\n`wsj-0-18-caseless-left3words-distsim`  | English  | Penn Treebank        |\n`wsj-0-18-bidirectional-distsim`        | English  | Penn Treebank        |\n`wsj-0-18-bidirectional-nodistsim`      | English  | Penn Treebank        |\n`german-hgc`                            | German   | STTS Treebank        | `german`\n`german-ud`                             | German   | STTS Treebank        |\n`german-fast`                           | German   | STTS Treebank        |\n`german-fast-caseless`                  | German   | STTS Treebank        |\n`french`                                | French   | French Treebank      | `french`\n`french-ud`                             | French   | French Treebank      |\n`spanish`                               | Spanish  | Spanish Treebank     | `spanish`\n`spanish-distsim`                       | Spanish  | Spanish Treebank     |\n`spanish-ud`                            | Spanish  | Spanish Treebank     |\n`arabic`                                | Arabic   | Bies Tags            | `arabic`\n`arabic-train`                          | Arabic   | Bies Tags            |\n`chinese-distsim`                       | Chinese  | LDC Chinese Treebank | `chinese`\n`chinese-nodistsim`                     | Chinese  | LDC Chinese Treebank |\n\nFor English we recommend the `english-left3words-distsim` (aliased as `english`) model or\nalternatively the `wsj-0-18-left3words-distsim` (aliased as `english-alt`) model (both with the\n[Penn Treebank PoS tags](http://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html)).\nFor German we recommend the `german-ghc` (aliased `german`) model (with the\n[STTS Treebank PoS tags](https://www.linguistik.hu-berlin.de/de/institut/professuren/korpuslinguistik/mitarbeiter-innen/hagen/STTS_Tagset_Tiger)).\n\nInstallation\n------------\n\n```shell\n$ npm install stanford-postagger\n```\n\nUsage\n-----\n\n```js\n(async () =\u003e {\n    const POS = require(\".\")\n    const pos = new POS()\n    await pos.start()\n    await pos.tag(\"The Stanford PoS-Tagger is a great piece of software!\").then((data) =\u003e {\n        console.log(data)\n    })\n    await pos.stop()\n})().catch((err) =\u003e {\n    console.log(`ERROR: ${err}`)\n})\n```\n\nOutput:\n\n```\nThe_DT Stanford_NNP PoS-Tagger_NNP is_VBZ a_DT great_JJ piece_NN of_IN software_NN !_.\n```\n\nApplication Programming Interface\n---------------------------------\n\n```ts\ndeclare class PoSTagger {\n    constructor(options?: {\n        javaBinary?: string   /* default: \"java\" */\n        javaOptions?: string  /* default: \"-server -Xms1G -Xmx1G\" */\n        tagger?:string        /* default: \"${__dirname}/stanford-postagger.d/stanford-postagger.jar\" */\n        model?: string        /* default: \"english\" */\n    })\n\n    public on(\n        event: string,\n        callback: (event: any) =\u003e void\n    ): void\n\n    public start(\n    ): Promise\u003cvoid\u003e\n\n    public tag(\n        text: string,\n    ): Promise\u003cstring\u003e\n\n    public stop(\n    ): Promise\u003cvoid\u003e\n}\n```\n\nMotivation\n----------\n\nThe major differences of [stanford-postagger](http://npmjs.com/stanford-postagger)\nto similar NPM modules and the motivation for the existence of\n[stanford-postagger](http://npmjs.com/stanford-postagger) are:\n\n1. [stanford-postagger](http://npmjs.com/stanford-postagger),\n   in contrast to the [node-stanford-postagger](http://npmjs.com/node-stanford-postagger) module,\n   does not depend on Docker or XML-RPC.\n   Instead, it just requires the `java` executable and speaks over stdin/stdout to the Stanford PoS-Tagger process.\n\n2. [stanford-postagger](http://npmjs.com/stanford-postagger),\n   in contrast to other scripting approaches, does not\n   spawn Stanford PoS-Tagger process for every query.\n   Instead, it uses a continuously running background process.\n\n3. [stanford-postagger](http://npmjs.com/stanford-postagger),\n   in contrast to other approaches, does not\n   need a pre-installed Stanford PoS-Tagger.\n   Instead, it automatically downloads and locally installs the Stanford\n   PoS-Tagger distribution on `npm install`.\n\nLicense\n-------\n\nCopyright (c) 2018-2019 Dr. Ralf S. Engelschall (http://engelschall.com/)\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frse%2Fstanford-postagger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frse%2Fstanford-postagger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frse%2Fstanford-postagger/lists"}