Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Node.js client for the NLP Cloud API. NLP Cloud serves all the spaCy pre-trained models, and your own custom models, through a RESTful API ready for production. More details here: https://nlpcloud.io Documentation: https://docs.nlpcloud.io
This is a Node.js client for the NLP Cloud API: https://docs.nlpcloud.io
NLP Cloud serves all the spaCy pre-trained models, and your own custom models, through a RESTful API, so it's easy for you to use them in production.
If you face an issue, don't hesitate to raise it as a Github issue. Thanks!
Install via npm.
npm install nlpcloud
Here is a full example that uses the en_core_web_sm
model, with a fake token:
import NLPCloud from 'nlpcloud'
var client = new NLPCloud('en_core_web_sm','4eC39HqLyjWDarjtT1zdp7dc')
client.entities("John Doe is a Go Developer at Google")
.then(function (response) {
console.log(response.data);
})
.catch(function (err) {
console.error(err.response.status);
console.error(err.response.data.detail);
});
And a full example that uses your own custom model 7894
:
import nlpcloud
client = nlpcloud.Client("custom_model/7894", "4eC39HqLyjWDarjtT1zdp7dc")
client.entities("John Doe is a Go Developer at Google")
A json object is returned. Here is what it could look like:
[
{
"end": 8,
"start": 0,
"text": "John Doe",
"type": "PERSON"
},
{
"end": 25,
"start": 13,
"text": "Go Developer",
"type": "POSITION"
},
{
"end": 35,
"start": 30,
"text": "Google",
"type": "ORG"
},
]
Pass the spaCy model you want to use and the NLP Cloud token to the client during initialization.
The spaCy model can either be a spaCy pretrained model like en_core_web_sm
, fr_core_news_lg
... but also one of your custom spaCy models using custom_model/<model id>
(e.g. custom_model/2568
).
Your token can be retrieved from your NLP Cloud dashboard.
import nlpcloud
client = nlpcloud.Client("<model>", "<your token>")
Call the entities()
method and pass the text you want to perform named entity recognition (NER) on.
client.entities("<Your block of text>")
The above command returns a JSON object.
Call the dependencies()
method and pass the text you want to perform part of speech tagging (POS) + arcs on.
client.dependencies("<Your block of text>")
The above command returns a JSON object.
Call the sentence_dependencies()
method and pass a block of text made up of several sentencies you want to perform POS + arcs on.
client.sentence_dependencies("<Your block of text>")
The above command returns a JSON object.
Call the lib_versions()
method to know the versions of the libraries used behind the hood with the model (for example the spaCy version used).
client.lib_versions()
The above command returns a JSON object.
FAQs
NLP Cloud serves high performance pre-trained or custom models for NER, sentiment-analysis, classification, summarization, paraphrasing, text generation, image generation, code generation, question answering, automatic speech recognition, machine translat
The npm package nlpcloud receives a total of 595 weekly downloads. As such, nlpcloud popularity was classified as not popular.
We found that nlpcloud demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.