{"id":42566324,"url":"https://github.com/nlpcloud/nlpcloud-go","last_synced_at":"2026-01-28T20:44:34.368Z","repository":{"id":44150400,"uuid":"330956917","full_name":"nlpcloud/nlpcloud-go","owner":"nlpcloud","description":"NLP Cloud serves high performance pre-trained or custom models for NER, sentiment-analysis, classification, summarization, paraphrasing, intent classification, product description and ad generation, chatbot, grammar and spelling correction, keywords and keyphrases extraction, text generation, image generation, code generation, and much more...","archived":false,"fork":false,"pushed_at":"2024-11-27T08:59:55.000Z","size":114,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-18T21:20:06.164Z","etag":null,"topics":["ad-generator","chatbot","dependency-parsing","go","grammar-correction","intent-classification","keyphrase-extraction","keyword-extraction","language-detection","machine-learning","machine-translation","ner","nlp","paraphrasing","question-answering","sentiment-analysis","text-classification","text-generation","text-summarization","tokenization"],"latest_commit_sha":null,"homepage":"https://nlpcloud.com","language":"Go","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/nlpcloud.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":"2021-01-19T11:25:18.000Z","updated_at":"2025-10-15T12:38:42.000Z","dependencies_parsed_at":"2023-10-30T17:30:59.650Z","dependency_job_id":"5a3385b2-e20b-4d58-8499-46b3b4a1dd89","html_url":"https://github.com/nlpcloud/nlpcloud-go","commit_stats":{"total_commits":115,"total_committers":2,"mean_commits":57.5,"dds":"0.11304347826086958","last_synced_commit":"6544df6147adc155dd3adb2d402a9cd1fcc44ddc"},"previous_names":[],"tags_count":61,"template":false,"template_full_name":null,"purl":"pkg:github/nlpcloud/nlpcloud-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlpcloud%2Fnlpcloud-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlpcloud%2Fnlpcloud-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlpcloud%2Fnlpcloud-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlpcloud%2Fnlpcloud-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nlpcloud","download_url":"https://codeload.github.com/nlpcloud/nlpcloud-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlpcloud%2Fnlpcloud-go/sbom","scorecard":{"id":690700,"data":{"date":"2025-08-11","repo":{"name":"github.com/nlpcloud/nlpcloud-go","commit":"704e21b5f4e53762aac12f07477e63fab18fdf73"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T02:14:25.403Z","repository_id":44150400,"created_at":"2025-08-22T02:14:25.403Z","updated_at":"2025-08-22T02:14:25.403Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28851240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ad-generator","chatbot","dependency-parsing","go","grammar-correction","intent-classification","keyphrase-extraction","keyword-extraction","language-detection","machine-learning","machine-translation","ner","nlp","paraphrasing","question-answering","sentiment-analysis","text-classification","text-generation","text-summarization","tokenization"],"created_at":"2026-01-28T20:44:34.284Z","updated_at":"2026-01-28T20:44:34.359Z","avatar_url":"https://github.com/nlpcloud.png","language":"Go","readme":"# Go Client For NLP Cloud\n\n[![reference](https://godoc.org/github.com/nlpcloud/nlpcloud-go/v5?status.svg=)](https://pkg.go.dev/github.com/nlpcloud/nlpcloud-go)\n[![go report](https://goreportcard.com/badge/github.com/nlpcloud/nlpcloud-go)](https://goreportcard.com/report/github.com/nlpcloud/nlpcloud-go)\n\nThis is a Go client for the [NLP Cloud](https://nlpcloud.com) API. See the [documentation](https://docs.nlpcloud.com) for more details.\n\nNLP Cloud serves high performance pre-trained or custom models for NER, sentiment-analysis, classification, summarization, dialogue summarization, paraphrasing, intent classification, product description and ad generation, chatbot, grammar and spelling correction, keywords and keyphrases extraction, text generation, image generation, question answering, automatic speech recognition, machine translation, language detection, semantic search, semantic similarity, tokenization, POS tagging, embeddings, and dependency parsing. It is ready for production, served through a REST API.\n\nYou can either use the NLP Cloud pre-trained models, fine-tune your own models, or deploy your own models.\n\nIf you face an issue, don't hesitate to raise it as a Github issue. Thanks!\n\n## Installation\n\nInstall using `go install`.\n\n```shell\ngo install github.com/nlpcloud/nlpcloud-go\n```\n\n## Examples\n\nHere is a full example that summarizes a text using Facebook's Bart Large CNN model, with a fake token:\n\n```go\npackage main\n\nimport (\n    \"net/http\"\n    \n    \"github.com/nlpcloud/nlpcloud-go\"\n)\n\nfunc main() {\n    client := nlpcloud.NewClient(\u0026http.Client{}, nlpcloud.ClientParams{\n        Model:\"bart-large-cnn\", Token:\"4eC39HqLyjWDarjtT1zdp7dc\", GPU:false, Lang:\"\", Async:false})\n    summarization, err := client.Summarization(nlpcloud.SummarizationParams{Text: `One month after\n    the United States began what has become a troubled rollout of a national COVID vaccination\n    campaign, the effort is finally gathering real steam. Close to a million doses -- over 951,000, to be more exact -- \n    made their way into the arms of Americans in the past 24 hours, the U.S. Centers \n    for Disease Control and Prevention reported Wednesday. That s the largest number \n    of shots given in one day since the rollout began and a big jump from the \n    previous day, when just under 340,000 doses were given, CBS News reported. \n    That number is likely to jump quickly after the federal government on Tuesday \n    gave states the OK to vaccinate anyone over 65 and said it would release all \n    the doses of vaccine it has available for distribution. Meanwhile, a number \n    of states have now opened mass vaccination sites in an effort to get larger \n    numbers of people inoculated, CBS News reported.`})\n    ...\n}\n```\n\nHere is a full example that does the same thing, but on a GPU:\n\n```go\npackage main\n\nimport (\n    \"net/http\"\n    \n    \"github.com/nlpcloud/nlpcloud-go\"\n)\n\nfunc main() {\n    client := nlpcloud.NewClient(\u0026http.Client{}, nlpcloud.ClientParams{\n        Model:\"bart-large-cnn\", Token:\"4eC39HqLyjWDarjtT1zdp7dc\", GPU:true, Lang:\"\", Async:false})\n    summarization, err := client.Summarization(nlpcloud.SummarizationParams{Text: `One month after\n    the United States began what has become a troubled rollout of a national COVID vaccination\n    campaign, the effort is finally gathering real steam. Close to a million doses -- over 951,000, to be more exact -- \n    made their way into the arms of Americans in the past 24 hours, the U.S. Centers \n    for Disease Control and Prevention reported Wednesday. That s the largest number \n    of shots given in one day since the rollout began and a big jump from the \n    previous day, when just under 340,000 doses were given, CBS News reported. \n    That number is likely to jump quickly after the federal government on Tuesday \n    gave states the OK to vaccinate anyone over 65 and said it would release all \n    the doses of vaccine it has available for distribution. Meanwhile, a number \n    of states have now opened mass vaccination sites in an effort to get larger \n    numbers of people inoculated, CBS News reported.`})\n    ...\n}\n```\n\nHere is a full example that does the same thing, but on a French text:\n\n```go\npackage main\n\nimport (\n    \"net/http\"\n    \n    \"github.com/nlpcloud/nlpcloud-go\"\n)\n\nfunc main() {\n    client := nlpcloud.NewClient(\u0026http.Client{}, nlpcloud.ClientParams{\n        Model:\"bart-large-cnn\", Token:\"4eC39HqLyjWDarjtT1zdp7dc\", GPU:true, Lang:\"fra_Latn\", Async:false})\n    summarization, err := client.Summarization(nlpcloud.SummarizationParams{Text: `Sur des images aériennes, \n    prises la veille par un vol de surveillance de la Nouvelle-Zélande, la côte d’une île est bordée \n    d’arbres passés du vert au gris sous l’effet des retombées volcaniques. On y voit aussi des immeubles\n    endommagés côtoyer des bâtiments intacts. « D’après le peu d’informations\n    dont nous disposons, l’échelle de la dévastation pourrait être immense, \n    spécialement pour les îles les plus isolées », avait déclaré plus tôt \n    Katie Greenwood, de la Fédération internationale des sociétés de la Croix-Rouge.\n    Selon l’Organisation mondiale de la santé (OMS), une centaine de maisons ont\n    été endommagées, dont cinquante ont été détruites sur l’île principale de\n    Tonga, Tongatapu. La police locale, citée par les autorités néo-zélandaises,\n    a également fait état de deux morts, dont une Britannique âgée de 50 ans,\n    Angela Glover, emportée par le tsunami après avoir essayé de sauver les chiens\n    de son refuge, selon sa famille.`})\n    ...\n}\n```\n\n## Usage\n\n### Client Initialization\n\nWhile it uses a HTTP REST API, you'll have to pass an instance that implements interface `HTTPClient`.\nIt works with a `*http.Client`.\n\nPass the model you want to use and the NLP Cloud token to the client during initialization.\n\nThe model can either be a pre-trained model like `en_core_web_lg`, `bart-large-mnli`, ... but also one of your custom models using `custom_model/\u003cmodel id\u003e` (e.g. `custom_model/2568`).\n\nYour token can be retrieved from your [NLP Cloud dashboard](https://nlpcloud.com/home/token).\n\n```go\npackage main\n\nimport (\n    \"net/http\"\n    \n    \"github.com/nlpcloud/nlpcloud-go\"\n)\n\nfunc main() {\n    client := nlpcloud.NewClient(\u0026http.Client{}, nlpcloud.`ClientParams{\n        Model:\"\u003cmodel\u003e\", Token:\"\u003ctoken\u003e\", GPU:false, Lang:\"\u003clanguage\u003e\", Async:false})\n    ...\n}\n```\n\nIf you want to use a GPU, set the 4th parameter as `true`.\n\nIf you want to use the multilingual add-on in order to process non-English texts, set your language code in the 5th parameter. For example, if you want to process French text, you should set the 5th parameter as `\"fra_Latn\"`.\n\nIf you want to make asynchronous requests, pass the 5th parameter as `true`. You will always receive a quick response containing a URL. You should then poll this URL with `nlpcloud.AsyncResult()` on a regular basis (every 10 seconds for example) in order to check if the result is available.\n\n### API endpoint\n\nDepending on the API endpoint, it may have parameters (only `LibVersions` does not follow this rule).\nIn case it has parameters, you can call an endpoint using the following:\n\n```go\nres, err := client.TheAPIEndpoint(params TheAPIEndpointParams)\n```\n\n### Streaming\n\nSome API endpoints support token streaming through Server Sent Events (SSE). Here is an example showing how to implement token streaming with the `generation` API endpoint:\n\n```go\nclient := nlpcloud.NewClient(\u0026http.Client{}, nlpcloud.ClientParams{Model: \u003cmodel_name\u003e, Token: \u003ctoken\u003e, GPU: true})\n\nstreamBody, err := client.StreamingGeneration(nlpcloud.GenerationParams{\n  Text: \"LLaMA is a powerful NLP model\",\n  MaxLength: 50,\n})\n\ndefer streamBody.Close()\n\nstream := bufio.NewReader(streamBody)\n\nfor {\n  chunk, err := stream.ReadBytes('\\x00')\n  if err != nil {\n    if errors.Is(err, io.EOF) {\n      break\n    }\n    log.Fatalln()\n  }\n\n  fmt.Println(string(chunk))\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlpcloud%2Fnlpcloud-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnlpcloud%2Fnlpcloud-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlpcloud%2Fnlpcloud-go/lists"}