Sure, here is an example of a simple neural network class in pure JavaScript with no libraries:

class NeuralNetwork {
  constructor(inputNodes, hiddenNodes, outputNodes) {
    this.inputNodes = inputNodes;
    this.hiddenNodes = hiddenNodes;
    this.outputNodes = outputNodes;

    // Initialize weights between input and hidden layers
    this.weightsInputToHidden = new Array(this.hiddenNodes).fill().map(() => new Array(this.inputNodes).fill().map(() => Math.random()));

    // Initialize weights between hidden and output layers
    this.weightsHiddenToOutput = new Array(this.outputNodes).fill().map(() => new Array(this.hiddenNodes).fill().map(() => Math.random()));
  }

  sigmoid(x) {
    return 1 / (1 + Math.exp(-x));
  }

  predict(input) {
    // Calculate hidden layer values
    const hiddenValues = this.weightsInputToHidden.map(weights => input.reduce((sum, value, index) => sum + (value * weights[index]), 0)).map(this.sigmoid);

    // Calculate output layer values
    const outputValues = this.weightsHiddenToOutput.map(weights => hiddenValues.reduce((sum, value, index) => sum + (value * weights[index]), 0)).map(this.sigmoid);

    return outputValues;
  }

  train(input, targetOutput, learningRate) {
    // Calculate hidden layer values
    const hiddenValues = this.weightsInputToHidden.map(weights => input.reduce((sum, value, index) => sum + (value * weights[index]), 0)).map(this.sigmoid);

    // Calculate output layer values
    const outputValues = this.weightsHiddenToOutput.map(weights => hiddenValues.reduce((sum, value, index) => sum + (value * weights[index]), 0)).map(this.sigmoid);

    // Calculate output layer errors
    const outputErrors = outputValues.map((value, index) => value * (1 - value) * (targetOutput[index] - value));

    // Calculate hidden layer errors
    const hiddenErrors = hiddenValues.map((value, index) => value * (1 - value) * this.weightsHiddenToOutput.reduce((sum, weights) => sum + (weights[index] * outputErrors[index]), 0));

    // Update weights between hidden and output layers
    this.weightsHiddenToOutput = this.weightsHiddenToOutput.map((weights, outputIndex) => weights.map((value, hiddenIndex) => value + (learningRate * outputErrors[outputIndex] * hiddenValues[hiddenIndex])));

    // Update weights between input and hidden layers
    this.weightsInputToHidden = this.weightsInputToHidden.map((weights, hiddenIndex) => weights.map((value, inputIndex) => value + (learningRate * hiddenErrors[hiddenIndex] * input[inputIndex])));
  }
}

This class has a constructor that takes in the number of input nodes, hidden nodes, and output nodes, and initializes the weights between the input and hidden layers and between the hidden and output layers randomly.

The class also has a sigmoid function that takes in a value and returns the result of the sigmoid function applied to that value.

The predict function takes in an array of input values and returns an array of output values based on the current weights.

The train function takes in an array of input values, an array of target output values, and a learning rate, and updates the weights based on the error between the predicted output values and the target output values.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence