Log text¶
Comet allows you to log any text to your Experiment, where a text is defined as any variable-length string.
Comet allows you to analyze experiment assets by loading them into Python Panels with custom code.
The following method can be used to log text samples:
In addition all the text samples logged to an Experiment can be view in the Single Experiment page tabs:
- Text Tab.
- Assets & Artifacts Tab:
text-samples
folder.
For example, you could...
Log text samples either at the end of a training run or during the run when training or fine-tuning an NLP model.
But keep in mind that you want to use CometLLM for prompt engineering workflows!
Log a text with metadata¶
The example below logs a single sentence representing a movie review with metadata defining the review sentiment.
1 2 3 4 5 6 7 8 9 10 11 12 |
|
The metadata
argument requires a JSON-encodable dictionary of any custom key<>value pairs. Additionally, you can pass the step
argument to associate the text to a training step.