// Using component configuration
const classifierNode = new TextClassifierNode({
id: 'content-classifier',
modelWeightsPath: '/models/classifier_weights.json',
embedderComponentId: 'text_embedder_component',
supportedClasses: ['hategroup', 'selfharm', 'sexual', 'sexualminors', 'substance'],
classifierConfig: {
classes: [
{ label: 'hategroup', threshold: 0.8 },
{ label: 'selfharm', threshold: 0.9 }
]
}
});
// Using existing text classifier component
const classifierComponent = new TextClassifierComponent({
id: 'existing-classifier-component',
modelWeightsPath: '/models/classifier_weights.json',
embedderComponentId: 'text_embedder_component',
supportedClasses: ['hategroup', 'selfharm']
});
const classifierNodeWithComponent = new TextClassifierNode({
id: 'content-classifier',
textClassifierComponent: classifierComponent
});