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

auraclassify

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auraclassify

AuraClassify is a powerful content moderation and classification system built on TensorFlow.js, utilizing the Universal Sentence Encoder for text analysis.

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
0
Weekly downloads
 
Created
Source

AuraClassify

AuraClassify is a powerful content moderation and classification system built on TensorFlow.js, utilizing the Universal Sentence Encoder for text analysis.

Features

  • Content moderation and classification
  • Multi-category support with subcategories
  • Confidence scoring and sentiment analysis
  • Detailed analysis reports
  • Easy to train and use
  • Supports both browser and Node.js environments

Installation

npm install auraclassify

Quick Start

const AuraClassify = require('auraclassify');

// Initialize classifier
const classifier = new AuraClassify({
    backend: "tfjs" // or "tfjs-node" for Node.js backend
});

// Train the model
await classifier.train({
    dataset: trainingData,
    log: true,
    batchSize: 4
});

// Classify text
const result = await classifier.classify("Text to analyze");

Training Data Format

Training data should be an array of objects with input and output properties:

const trainingData = [
    {
        input: "Example text content",
        output: "category" // or "category/subcategory"
    }
];

Supported Categories

  • safe: Safe content
  • sexual: Adult content
  • harassment: Harassment content
  • hate: Hate speech
  • illicit: Illegal content
  • self-harm: Self-harm content
  • violence: Violent content

Each category can have subcategories (e.g., "violence/threatening", "self-harm/instructions")

API Reference

Constructor

const classifier = new AuraClassify({ backend = "tfjs" });

Methods

train(options)
await classifier.train({
    dataset: trainingData,
    log: true,
    batchSize: 4
});
classify(text)
const result = await classifier.classify("Text to analyze");
save(path)
await classifier.save("path/to/model.json");
load(path)
await classifier.load("path/to/model.json");

How It Works

AuraClassify uses the Universal Sentence Encoder to convert text into high-dimensional vectors (embeddings). These embeddings capture semantic meaning, allowing the system to understand context and nuance in text.

The classification process involves:

  1. Text embedding generation
  2. Similarity comparison with trained examples
  3. Category and subcategory detection
  4. Confidence scoring
  5. Detailed analysis generation

Example Output

{
    analysis: {
        input: {
            text: "Original text",
            length: 12,
            wordCount: 2
        },
        result: {
            label: "category/subcategory",
            confidence: 0.85,
            confidenceLevel: "HIGH"
        },
        // ... additional analysis data
    },
    summary: {
        decision: "CATEGORY (HIGH confidence level)",
        confidence: 0.85,
        status: "RELIABLE"
    }
}

License

Apache License 2.0

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For issues and feature requests, please use the GitHub issues page.

Keywords

FAQs

Package last updated on 02 Nov 2024

Did you know?

Socket

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.

Install

Related posts

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