Skip to content

Commit

Permalink
Add note about low-confidence classifications
Browse files Browse the repository at this point in the history
  • Loading branch information
hellojwilde committed Jun 11, 2023
1 parent f021cd5 commit f3cad96
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions website/docs/guides/classifiers.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,27 @@ import { initClassifier } from "@energetic-ai/classifiers";
})();
```

## Filtering low confidence classifications

The classifier will return a classification for every input string. However, if you're classifying something that's not in the training data, this prediction might not be very accurate.

Classification results contain confidence values for each potential label. You can use this to filter out low-confidence predictions:

```js
[
{
classIndex: 1,
label: "Negative",
confidences: { Positive: 0, Negative: 1 },
},
{
classIndex: 0,
label: "Positive",
confidences: { Positive: 0.6666666666666666, Negative: 0.3333333333333333 },
},
];
```

## Improving cold-start performance

The first time you call `initClassifier()`, it will download model weights for the [embeddings](embeddings.md) package from the internet. This can take a few seconds, but you can speed it up by installing the English language model weights:
Expand Down

0 comments on commit f3cad96

Please sign in to comment.