Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nlpcloud

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nlpcloud - npm Package Compare versions

Comparing version 1.0.12 to 1.0.13

13

index.js

@@ -39,4 +39,5 @@ const axios = require('axios')

generation(text, minLength = null, maxLength = null, lengthNoInput = null,
endSequence = null, removeInput = null, topK = null, topP = null,
temperature = null, repetitionPenalty = null, lengthPenalty = null) {
endSequence = null, removeInput = null, doSample = null, numBeams = null, earlyStopping = null,
noRepeatNgramSize = null, numReturnSequences = null, topK = null, topP = null,
temperature = null, repetitionPenalty = null, lengthPenalty = null, badWords = null) {
const payload = {

@@ -49,2 +50,7 @@ 'text': text,

'remove_input': removeInput,
'do_sample': doSample,
'num_beams': numBeams,
'early_stopping': earlyStopping,
'no_repeat_ngram_size': noRepeatNgramSize,
'num_return_sequences': numReturnSequences,
'top_k': topK,

@@ -54,3 +60,4 @@ 'top_p': topP,

'repetition_penalty': repetitionPenalty,
'length_penalty': lengthPenalty
'length_penalty': lengthPenalty,
'bad_words': badWords
};

@@ -57,0 +64,0 @@

{
"name": "nlpcloud",
"version": "1.0.12",
"version": "1.0.13",
"description": "NLP Cloud serves high performance pre-trained or custom models for NER, sentiment-analysis, classification, summarization, text generation, question answering, machine translation, language detection, tokenization, POS tagging, and dependency parsing. It is ready for production, served through a REST API.\n\nThis is the Node.js client for the NLP Cloud API.\n\nMore details here: https://nlpcloud.io\n\nDocumentation: https://docs.nlpcloud.io",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -140,2 +140,7 @@ # Node.js Client For NLP Cloud

1. (Optional) `removeInput`: Whether you want to remove the input text form the result, as a boolean. Defaults to false.
1. (Optional) `doSample`: Whether or not to use sampling ; use greedy decoding otherwise, as a boolean. Defaults to true.
1. (Optional) `numBeams`: Number of beams for beam search. 1 means no beam search. This is an integer. Defaults to 1.
1. (Optional) `earlyStopping`: Whether to stop the beam search when at least num_beams sentences are finished per batch or not, as a boolean. Defaults to false.
1. (Optional) `noRepeatNgramSize`: If set to int > 0, all ngrams of that size can only occur once. This is an integer. Defaults to 0.
1. (Optional) `numReturnSequences`: The number of independently computed returned sequences for each element in the batch, as an integer. Defaults to 1.
1. (Optional) `topK`: The number of highest probability vocabulary tokens to keep for top-k-filtering, as an integer. Maximum 1000 tokens. Defaults to 0.

@@ -146,3 +151,5 @@ 1. (Optional) `topP`: If set to float < 1, only the most probable tokens with probabilities that add up to top_p or higher are kept for generation. This is a float. Should be between 0 and 1. Defaults to 0.7.

1. (Optional) `lengthPenalty`: Exponential penalty to the length, as a float. 1.0 means no penalty. Set to values < 1.0 in order to encourage the model to generate shorter sequences, or to a value > 1.0 in order to encourage the model to produce longer sequences. Defaults to 1.0.
1. (Optional) `badWords`: List of tokens that are not allowed to be generated, as a list of strings. Defaults to null.
```js

@@ -149,0 +156,0 @@ client.generation("<Your input text>")

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc