{"id":29271225,"url":"https://github.com/securisec/go-keywords","last_synced_at":"2025-07-04T23:08:13.631Z","repository":{"id":101781669,"uuid":"272091848","full_name":"securisec/go-keywords","owner":"securisec","description":"Keyword extraction using go","archived":false,"fork":false,"pushed_at":"2020-06-19T13:59:56.000Z","size":38,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-28T14:03:11.300Z","etag":null,"topics":["extract","go","keyword-extraction","keywords"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/securisec.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":"2020-06-13T21:56:13.000Z","updated_at":"2025-03-29T19:14:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"f22c4731-1142-40f0-bf80-0ed7a89187d5","html_url":"https://github.com/securisec/go-keywords","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/securisec/go-keywords","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/securisec%2Fgo-keywords","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/securisec%2Fgo-keywords/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/securisec%2Fgo-keywords/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/securisec%2Fgo-keywords/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/securisec","download_url":"https://codeload.github.com/securisec/go-keywords/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/securisec%2Fgo-keywords/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263632058,"owners_count":23491530,"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":["extract","go","keyword-extraction","keywords"],"created_at":"2025-07-04T23:08:11.167Z","updated_at":"2025-07-04T23:08:13.615Z","avatar_url":"https://github.com/securisec.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://github.com/securisec/go-keywords/workflows/tests/badge.svg)\n\n# go-keywords\n\n`go-keywords` is an attempt to port over the npm package `keyword-extractor`. It is not as in depth as its npm package, but gets the work done. `go-keywords` works with both regular strings, and html data.\n\n**Why?** While in search for a simple keyword extractor, i came across a few packages that uses the RAKE concept, but for my use case to simply extract individual keywords, it wasnt sufficient.\n\n## Install\n```go\ngo get github.com/securisec/go-keywords\n```\n\n## Use\n\n### keywords.ExtractOptions\nThe `Extract` functions default behavior can be altered passing the `ExtractOptions` struct. The options and their default values are:\n\n```go\ntype ExtractOptions struct {\n\tRemoveDigits     bool     // Remove digits from found words. Defaults to true\n\tRemoveDuplicates bool     // Remove duplications from found words. Defaults to true\n\tLowercase        bool     // Change all found words to lowercase. Defaults to true\n\tLanguage         string   // Language to use for keywords extraction. Defaults to \"en\"\n\tAddStopwords     []string // Append additional stopwords to ignore. Defaults to empty array\n\tIgnorePattern    string   // Ignore matches for the specified regex pattern. Defaults to \"\"\n\tStripTags        bool     // Strip HTML tags. Defaults to false\n}\n```\n\n### Simple use case\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/securisec/go-keywords\"\n)\n\nfunc main() {\n\tdata := \" How to solve a GeeTest 1 123 “slider CAPTCHA” with JS \"\n\tk, _ := keywords.Extract(data)\n\tfmt.Println(k)\n}\n\n// [solve geetest slider captcha js]\n```\n\n### Get keywords from html\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\n\t\"github.com/securisec/go-keywords\"\n)\n\nfunc main() {\n\treq, _ := http.Get(\"http://example.com\")\n\tdata, _ := ioutil.ReadAll(req.Body)\n\tk, _ := keywords.Extract(string(data), keywords.ExtractOptions{\n\t\tStripTags:        true,\n\t\tRemoveDuplicates: true,\n\t\tIgnorePattern:    \"\u003c.+\u003e\",\n\t\tLowercase:        true,\n\t})\n\tfmt.Println(k)\n}\n\n\n// [illustrative examples documents information domain literature prior coordination permission]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecurisec%2Fgo-keywords","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecurisec%2Fgo-keywords","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecurisec%2Fgo-keywords/lists"}