Skip to content

Log text#

You have several options for logging text to a Neptune object.

Free-form text#

Small piece of text#

You can assign a single string to a field:

# Log single string
run["aux/text"] = "Text I keep track of, like query or tokenized word"

or iteratively log a series of short text entries (max 1000 characters) with the append() method:

# Log series of strings to the same field
for epoch in range(epochs_nr):
    token = str(...)
    run["train/tokens"].append(token)

Long piece of text#

If your string is long, it may be handier to upload as a text file instead.

  • Option A) Log the text as a file by utilizing the from_content() method of the Python API:

    from neptune.types import File
    
    run["large_text_as_file"].upload(File.from_content(variable_with_my_text))
    
  • Option B) Manually save your text as a file on disk, then upload that:

    run["large_text_file"].upload("my_text.txt")
    

Note

Due to a technical limitation, we now limit the number of indexed characters in String fields to 1000 characters. This means that for runs table search, only the first 1000 characters will be considered.

Description of the run#

Tip

You can edit the name of the object in the same way, with the name argument or the sys/name field.

Adding a description is one way to annotate or comment on the object. You can add the description either when first creating the object or later through the web app.

Adding a description at initialization#

Pass some text to the description argument when initializing a run:

run = neptune.init_run(
    description="NN trained on Fashion-MNIST with high LR and low dropout"
)

This stores the tags in the sys/description field. You can modify it later by editing this field either through the web app or the API.

Adding a description later#

You can also edit the description field directly:

  1. Next to the run ID, click the menu () and select Show run information.
  2. Edit the Description field.
  3. Save your changes.
run["sys/description"] = "Neural net trained on Fashion-MNIST"

If you want to edit the description a previously created object, you need to resume it first:

run = neptune.init_run(with_id="RUN-ID") # (1)!
run["sys/description"] = ...
  1. The ID of the run. For example, CLAS-13.

To modify an existing description, simply overwrite it with a new string.

Viewing and editing run information

Tip

You can use emoji in any string (except StringSeries fields):

run = neptune.init_run(name="Special run ⭐️")