A Simple Node.js Naive Bayes Library.

Overview

Idnaive

idnaive - A Simple Node.js Naive Bayes Library

Idnaive is A Simple Node.js Naive Bayes Library.

Multilanguage Stemming (Indonesia + English)
Out String Filter
Punctuation Filter
Fix Zero-Frequency Problem

Installation

npm install idnaive

Usage

const NaiveBayes = require("idnaive");

const naiveBayes = new NaiveBayes("en");

const datasets = [
  ["You're doing good and expressive", "positive"],
  ["You're doing wow and nice", "positive"],
  ["What is this? very waste of time, and bad", "negative"],
];

naiveBayes.learn(...datasets);

let result = naiveBayes.classify(
  "This is bad, and you should try better because it waste my time"
);
console.log(result);

Datasets example :

Data Label
Hello World Inggris
Hello World Inggris
Hello World Arab
Kun Fayakun Arab

Input Data : Aku suka makan hello world

Calculation

Label | Inggris = 2/4
Label | Arab = 2/4

Hello World | Inggris = 2/2
Hello World | Arab = 1/2

P | Inggris = 2/4 x 2/2 = 0.5
P | Arab = 2/4 X 1/2 = 0.25

Parameters

  • new NaiveBayes(languageCode)
    • languageCode: languageCode determines what language used for stemming by the language code. currently idnaive supports id (Indonesia) and en (English).

License

Idnaive licensed by MIT License

Contribute

Before contributing, please read the following CODE_OF_CONDUCT.md and CONTRIBUTING.md.

Credits

Credits to their amazing open source:

You might also like...

This is a vanilla Node.js rest API created to show that it is possible to create a rest API using only vanilla Node.js

This is a vanilla Node.js rest API created to show that it is possible to create a rest API using only vanilla Node.js. But in most cases, I would recommend you to use something like Express in a production project for productivity purposes.

Jul 19, 2022

Inter Process Communication Module for node supporting Unix sockets, TCP, TLS, and UDP. Giving lightning speed on Linux, Mac, and Windows. Neural Networking in Node.JS

Inter Process Communication Module for node supporting Unix sockets, TCP, TLS, and UDP. Giving lightning speed on Linux, Mac, and Windows. Neural Networking in Node.JS

Inter Process Communication Module for node supporting Unix sockets, TCP, TLS, and UDP. Giving lightning speed on Linux, Mac, and Windows. Neural Networking in Node.JS

Dec 9, 2022

Node js package makes creating node jd dependincies files like Controllers,Entities and Repositories easier by executing a few instructions

Node js package makes creating node jd dependincies files like Controllers,Entities and Repositories easier by executing a few instructions

Nodejs Studio Node js package makes creating node js project dependincies files like Controllers,Entities and Repositories easier by executing a few i

Oct 12, 2022

Spin node create spin api for node

Links Contract api JS api @spinfi/core @spinfi/node @spinfi/node Spin node create spin api for node How to install yarn add @spinfi/node How to init i

Oct 18, 2022

Mixed Messages is a simple Node.js application, that will print a randomized fake fact to the terminal each time it is ran.

Mixed Messages - Fake Fact Generator Mixed Messages is a simple Node.js application, That will print a randomized fake fact to the terminal each time

Jan 10, 2022

simple statistics for node & browser javascript

Simple Statistics A JavaScript implementation of descriptive, regression, and inference statistics. Implemented in literate JavaScript with no depende

Jan 7, 2023

An simple blockchain example on node + typescript.

node-ts-blockchain An simple blockchain example on node + typescript. Next steps: Create a usefull README. Add a architecture to store the chain/block

May 30, 2022

A Node.js framework for development of fast, simple, lightweight website.

MiuJS Web Framework A simple and minimal web framework using the JavaScript and Node.js. Featuring: builtin server multiple deploy target node vercel

Jun 19, 2022

Provides simple and the most useful methods to string operations in JavaScript / Node.js

🔪 Strops (String Operations) Provides simple methods for the most useful operations with substrings: - remove, replace, get from A to B, get from A t

May 20, 2022
Releases(0.0.5)
Owner
FNC
I'm interested in programming design patterns (and anti-patterns), blockchain, javascript tools and all technologies in a dynamic Javascript environment.
FNC
A simple library to draw option menu or other popup inputs and layout on Node.js console.

console-gui-tools A simple library to draw option menu or other popup inputs and layout on Node.js console. console-gui-tools A simple Node.js library

Elia Lazzari 12 Dec 24, 2022
I'm trying to create simple program for adding the digital signature to a pdf file with self-signed certificate. I use node-signpdf and pdf-lib library.

pdf-digital-signature-with-node-signpdf-ejs I'm trying to create simple program for adding the digital signature to a pdf file with self-signed certif

null 5 Dec 25, 2022
Simple email automation library for Node.js

Dakiya Simple email automation for Node.js made easy. Features Zero config management: Use simple, chainable code to create email sequences. Email pla

Arnav Gosain 12 Sep 22, 2022
Simple and easy-to-use pagination library for Mongoose (Node.js)

node-paginator Simple and easy-to-use pagination library for Mongoose (Node.js) ?? Why node-paginator? Every web developer should work on pagination a

CareerDay 2 Sep 21, 2022
A simple library for Node and the browser that allows you to rapidly develop stateful, socketed multiplayer games and web applications.

gameroom.js Overview gameroom.js is a simple library for Node and the browser that allows you to rapidly develop stateful, socketed multiplayer games

Jackson Bierfeldt 3 Nov 3, 2022
A JavaScript library built on top of the Faker.JS library. It generates massive amounts of fake data in the browser and node.js.

Blaver - generate massive amounts of fake data in the browser and node.js Blaver is a JavaScript library built on top of the Faker.JS library. It gene

Priyansh 113 Dec 30, 2022
Simple Library implemented using HTML, CSS and JavaScript. This is a simple implementation of JavaScript Modules of ES6.

Awesome-books A single page project with the porpuse of storing books' titles and authors. Built With CSS, HTML & Javascript. How to run in your local

Saadat Ali 7 Feb 21, 2022
A simple library to view large images up close using simple mouse interaction, and the full screen.

Intense Images A stand alone javascript library for viewing images on the full, full screen. Using the touch/mouse position for panning. Here's a demo

Tim Holman 2.6k Dec 31, 2022
Node-cli-starter - Basic starter kit for building Node CLI applications with TypeScript.

node-cli-starter Minimal starter kit for building Node CLI applications with TypeScript. Getting Started To get started clone repo locally and run npm

Cory Rylan 7 May 17, 2022
Apilytics for Node.js - Easy API analytics for Node backends

apilytics-node Apilytics is a service that lets you analyze operational, performance and security metrics from your APIs without infrastructure-level

Apilytics 9 Sep 2, 2022