Import Data with CSV and TSV Files | Clarifai Docs

Enjoy the convenience of working with spreadsheet data

You can upload your text directly from a .csv ( comma separated values) or .tsv ( tab separated values) file.

This means you can work with your favorite spreadsheet software or text editor when preparing your data for upload.

This can be especially useful when you want to upload inputs and concepts at the same time. Just use the provided "CSV template" to get started.

CSV templates

To help you get started, you can download .csv templates for images and text uploads here:

Working With Your CSV File

At a minimum, you should add an image URL or text to the input.data.image.url or input.data.text.raw field respectively.

You can add one concept per column to the input.data.concepts[*].id fields. For the input.data.concepts[*].value column, there are two options: enter the number 1 if the concept is present in the input, enter the value 0 if the concept is not present in the input (a negative example).

If no value is entered, a default value of 1 will be assigned to your input.

You can add columns for as many concepts as you like, and you can add new columns to add values for any other values supported by the API:

Field Description
input.id A unique identifier for your input
input.data.image.url The URL (web address) for your input
input.data.text.raw The "text" for your input
input.data.concepts[i].id Your custom concept
input.data.concepts[i].value The value for your custom concept (1 for true, 0 for false)
input.data.metadata Any additional metadata in valid JSON format
input.data.geo.geo_point.latitude Latitude for geodata
input.data.geo.geo_point.longitude Longitude for geodata

Finally, you will need to save your work as a .csv file.

If you are editing in Google Sheets, go to File >>> Download >>> Comma-separated values (.csv, current sheet).

If you are using Excel, go to File >>> Save As >>> Browse >>> Save as Type >>> CSV.

Once you have downloaded the .csv file, you can then upload it to the Clarifai platform.