Positive and Negative Annotations | Clarifai Docs
Learn how to make positive and negative annotations
Positive and negative annotations play a critical role in training machine learning models.
Positive annotations help the model identify and learn the features associated with a particular input. Negative annotations, on the other hand, help the model distinguish between similar inputs by highlighting what the input is not.
Some inputs may also have overlapping features, especially in complex datasets. Providing both positive and negative annotations reduces the risk of the model misclassifying similar but distinct inputs, leading to more precise predictions.
By annotating your data with both positive and negative labels, you provide your model with the comprehensive information it needs to learn effectively, which results in better performance and more reliable outcomes.
value
- The
valueparameter is used to specify the presence of a concept in a request. Avalueof 1.0 indicates that the concept is present (true), while avalueof 0.0 indicates that the concept is not present (false). - When making HTTP requests, if the
valueparameter is omitted, it defaults to a positive annotation. In contrast, for gRPC requests, a missingvalueis interpreted as a negative annotation. To avoid unintended behavior, it's recommended to always explicitly set thevalueparameter in your requests.
Positive Annotation
If an input is tagged with a positive annotation, it is considered a positive label for it.
Example for Python (gRPC)
USER_ID = 'YOUR_USER_ID_HERE'
PAT = 'YOUR_PAT_HERE'
APP_ID = 'YOUR_APP_ID_HERE'
INPUT_ID = "53d0362a9dfa4e03b2293375e2d0db73"
CONCEPT_ID_1 = "tree"
CONCEPT_ID_2 = "water"
# Continue with implementation...
Example for JavaScript (REST)
const USER_ID = 'YOUR_USER_ID_HERE';
const PAT = 'YOUR_PAT_HERE';
const APP_ID = 'YOUR_APP_ID_HERE';
// Change these based on the image you want to annotate
const INPUT_ID = "c99f1b557d1d43d1916b46f8ce4a0487";
const CONCEPT_ID_1 = "tree";
const CONCEPT_ID_2 = "water";
// Continue with implementation...
Negative Annotation
If an input is tagged with a negative annotation, it is treated as a negative label for that concept. It emphasizes that the input does not belong to that concept.
Continue with implementation...
// Continue with implementation...