Supported Formats

Sources: Wikipedia and IANA

This page details all the supported Datasaur formats, provides examples for each format and clarifies expected file structure where appropriate.

TSV

A TSV (tab-separated values) file is a simple text format for storing data in a tabular structure. A TSV file encodes a number of records that may contain multiple fields.

  • Each record is represented as a single line.

  • Each field value is represented as text.

  • Fields in a record are separated from one other by the tab character \t.

    • Note that because \t is a special character for this format, fields that contain tabs are not allowed in this encoding.

  • The header (first) line of this encoding contains the name of each field, separated by tabs.

Example

Book Title Author Genre
Sherlock Holmes: A Study in Scarlet Sir Arthur Conan Doyle Fiction
To Kill a Mockingbird Harper Lee Fiction
Alan Turing: The Enigma Andrew Hodges Non fiction
Humble Pie Gordon Ramsay Non fiction
The Little Prince Antoine de Saint-Exupéry Fiction

IOB (specialized .tsv)

IOB (inside, outside, beginning) is a common labeling format for labeling tokens in computational linguistics (ex: named-entity recognition). IOB is also a .tsv, but conforms to the following rules:

  • The B- prefix before a tag indicates that the tag is the beginning of a chunk.

  • The I- prefix before a tag indicates that the tag is inside a chunk.

  • The B- tag is used only when a tag is followed by a tag of the same type without O tokens between them.

  • The O tag indicates that a token does not belong to a chunk.

Example

Sherlock B-PER
Holmes I-PER
become
widely
popular
in
1891 YEAR
.

CSV

A CSV (comma-separated values) file is a delimited text file that uses a comma to separate values. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. The use of the comma as a field separator is the source of the name for this file format.

A CSV file typically stores tabular data (numbers and text) in plain text, in which case each line will have the same number of fields.

Example

Book Title,Author,Genre
Sherlock Holmes: A Study in Scarlet,Sir Arthur Conan Doyle,Fiction
To Kill a Mockingbird,Harper Lee,Fiction
Alan Turing: The Enigma,Andrew Hodges,Non fiction
Humble Pie,Gordon Ramsay,Non fiction
The Little Prince,Antoine de Saint-Exupéry,Fiction

XLSX

XLSX is a well-known format for Microsoft Excel documents that was introduced by Microsoft with the release of Microsoft Office 2007. An XLSX file is also typically used to store tabular data.

Example

💡You may find a sample file here.

JSON

JSON (JavaScript Object Notation) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and array data types (or any other serializable value).

A JSON file may contain the following data structures:

  • An object is an unordered set of name/value pairs.

    • An object begins with {left brace and ends with }right brace. Each name is followed by :colon and the name/value pairs are separated by ,comma.

  • An array is an ordered collection of values.

    • An array begins with [left bracket and ends with ]right bracket. Values are separated by ,comma.

  • A value can be a string in double quotes, or a number, or true or false or null, or an object or an array. These structures can be nested.

  • A string is a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes. A character is represented as a single character string. A string is very much like a C or Java string.

  • A number is like a C or Java number, except that the octal and hexadecimal formats are not used.

  • Whitespace can be inserted between any pair of tokens. Excepting a few encoding details, that completely describes the language.

In the example below, here are the objects recognized at Datasaur.

  • text: the sentence.

  • entity.text: the token.

  • type: the label applied.

  • start_idx: the character position in the labeled token.

    • The character position uses zero-based index.

  • end_idx: the last character position + 1 (because end_index does not include the last character).

    • The character position uses zero-based index.

💡 "entities": [] value is required for now. This is to distinguish between our token-based JSON format and free-form JSON format. We will make it optional in the future.

Example

[
{
"text": "The new series Narcos created by Chris Brancato , Eric Newman and Carlo Bernard , represents a pretty ambitious step for Netflix .",
"entities": [
{
"text": "Narcos",
"type": "TITLE",
"start_idx": 15,
"end_idx": 21
},
{
"text": "Chris Brancato",
"type": "PER",
"start_idx": 33,
"end_idx": 47
},
{
"text": "Carlo Bernard",
"type": "PER",
"start_idx": 66,
"end_idx": 79
},
{
"text": "Eric Newman",
"type": "PER",
"start_idx": 50,
"end_idx": 61
},
{
"text": "Netflix",
"type": "ORG",
"start_idx": 121,
"end_idx": 128
}
]
}
]

JSON_TABULAR

JSON_TABULAR is a derivative of the JSON format that is used to represent table data format (in the form of an array of objects). You can choose this format if you are working on row-based labeling.

Example

[
{
"Book Title": "Sherlock Holmes: A Study in Scarlet",
"Author": "Sir Arthur Conan Doyle",
"Genre": "Fiction"
},
{
"Book Title": "To Kill a Mockingbird",
"Author": "Harper Lee",
"Genre": "Fiction"
},
{
"Book Title": "Alan Turing: The Enigma",
"Author": "Andrew Hodges",
"Genre": "Non fiction"
},
{
"Book Title": "Humble Pie",
"Author": "Gordon Ramsay",
"Genre": "Non fiction"
},
{
"Book Title": "The Little Prince",
"Author": "Antoine de Saint-Exupéry",
"Genre": "Fiction"
}
]

TSV_NON_IOB

TSV_NON_IOB is a derivative of the TSV format that represents data that does not follow the IOB format - for example, B-GEO is just GEO. If your project is token-based (with or without arrows), you can choose this format for export.

A TSV_NON_IOB file contains the following data structure (this explanation is based on our example below):

  1. #FORMAT: the file header.

  2. #Text: the sentence representation.

  3. 1-1: the sentence-token.

    1. The first 1 indicates the sentence number.

    2. The second 1 indicates the token number.

  4. 0-3: the character index.

  5. TITLE[1]: the label applied.

    1. [1] indicates uniquely identify annotation across lines.

  6. Column 5: indicates layer 2.

  7. author[2-1]: the label on the arrow.

    1. 2 indicates the arrow’s token origin.

    2. 1 indicates the arrow’s token destination.

  8. Column 7: indicates layer 4.

  9. Column 8: indicates layer 5.

Note: column 5, 7, and 8 will be filled if you label the token in the mentioned layers.

💡We built this format to be compatible with WebAnno.

Example (token-based)

#FORMAT=Datasaur TSV 3
#Text=The Little Prince is a novella by French aristocrat , writer , and aviator Antoine de Saint - Exupéry .
1-1 0-3 The TITLE[1] _ _ _ _
1-2 4-10 Little TITLE[1] _ _ _ _
1-3 11-17 Prince TITLE[1] _ _ _ _
1-4 18-20 is _ _ _ _ _
1-5 21-22 a _ _ _ _ _
1-6 23-30 novella _ _ _ _ _
1-7 31-33 by _ _ _ _ _
1-8 34-40 French _ _ _ _ _
1-9 41-51 aristocrat _ _ _ _ _
1-10 52-53 , _ _ _ _ _
1-11 54-60 writer _ _ _ _ _
1-12 61-62 , _ _ _ _ _
1-13 63-66 and _ _ _ _ _
1-14 67-74 aviator _ _ _ _ _
1-15 75-82 Antoine PER[2] _ _ _ _
1-16 83-85 de PER[2] _ _ _ _
1-17 86-91 Saint PER[2] _ _ _ _
1-18 92-93 - PER[2] _ _ _ _
1-19 94-101 Exupéry PER[2] _ _ _ _
1-20 102-103 . _ _ _ _ _

Example (token-based with arrows)

#FORMAT=Datasaur TSV 3
#Text=The Little Prince is a novella by French aristocrat , writer , and aviator Antoine de Saint - Exupéry .
1-1 0-3 The TITLE[1] _ * author[2_1] _
1-2 4-10 Little TITLE[1] _ _ _ _
1-3 11-17 Prince TITLE[1] _ _ _ _
1-4 18-20 is _ _ _ _ _
1-5 21-22 a _ _ _ _ _
1-6 23-30 novella _ _ _ _ _
1-7 31-33 by _ _ _ _ _
1-8 34-40 French _ _ _ _ _
1-9 41-51 aristocrat _ _ _ _ _
1-10 52-53 , _ _ _ _ _
1-11 54-60 writer _ _ _ _ _
1-12 61-62 , _ _ _ _ _
1-13 63-66 and _ _ _ _ _
1-14 67-74 aviator _ _ _ _ _
1-15 75-82 Antoine PER[2] _ _ _ _
1-16 83-85 de PER[2] _ _ _ _
1-17 86-91 Saint PER[2] _ _ _ _
1-18 92-93 - PER[2] _ _ _ _
1-19 94-101 Exupéry PER[2] _ _ _ _
1-20 102-103 . _ _ _ _ _

CoNLL-U

Universal Dependencies use a revised version of the CoNLL-X format called CoNLL-U. Sentences consist of one or more word lines, and word lines contain the following fields:

  1. sent_id: Sentence id.

  2. text: Sentence.

  3. ID: Word index, integer starting at 1 for each new sentence; may be a range for multiword tokens; may be a decimal number for empty nodes (decimal numbers can be lower than 1 but must be greater than 0).

  4. FORM: Word form or punctuation symbol.

  5. LEMMA: Lemma or stem of word form.

  6. XPOS: Language-specific part-of-speech tag; underscore if not available.

  7. FEATS: List of morphological features from the universal feature inventory or from a defined language-specific extension; underscore if not available.

  8. HEAD: Head of the current word, which is either a value of ID or zero (0).

  9. DEPREL: Universal dependency relation to the HEAD (root iff HEAD = 0) or a defined language-specific subtype of one.

  10. DEPS: Enhanced dependency graph in the form of a list of head-deprel pairs.

  11. MISC: Any other annotation.

Example

# sent_id = 1
# text = Sherlock Holmes become widely popular in 1891 .
1 Sherlock _ _ NNP _ 3 nsubj _ _
2 Holmes _ _ NNP _ _ _ _ _
3 become _ _ VBD _ 0 root _ _
4 widely _ _ RB _ 5 advmod _ _
5 popular _ _ JJ _ 3 xcomp _ _
6 in _ _ IN _ _ _ _ _
7 1891 _ _ CD _ _ _ _ _
8 . _ _ . _ _ _ _ _

CoNLL

CoNLL is also a .tsv, and targets semantic role labeling. Columns are tab-separated. Sentences are separated by a blank new line.

Example

1 Sherlock _ _ _ _ 0 _ _ _
2 Holmes _ _ _ _ 0 _ _ _
3 become _ _ _ _ 0 _ _ _
4 widely _ _ _ _ 0 _ _ _
5 popular _ _ _ _ 0 _ _ _
6 in _ _ _ _ 0 _ _ _
7 1891 _ _ YEAR _ 0 _ _ _
8 . _ _ _ _ 0 _ _ _

CoNLL_2003

CoNLL_2003 is usually used for POS tagging and named entity recognition labeling. All data files contain one word per line with empty lines representing sentence boundaries. At the end of each line there is a tag which states whether the current word is inside a named entity or not. The tag also encodes the type of named entity. Each line contains four fields:

  1. The word

  2. Part of-speech tag

  3. Chunk tag

  4. Named entity tag

Note: Importing or exporting files with conll_2003 format can be done if you checked the following task settings.

  • Tokens and token spans should have at most one label.

  • Allow arrows to be drawn between labels. Checking this setting will activate layer feature.

You could do POS tagging on Layer 0 and NER tagging on Layer 1. If you export the file with conll_2003, the result will be as shown as example below.

Example

Sherlock NNP B-Person O
Holmes NNP I-Person O
become VB O O
widely RB O O
popular JJ O O
in IN O O
1891 CD B-Year O
. . O O

JSON_ADVANCED

JSON_ADVANCED is a proprietary Datasaur format designed in collaboration with our users to capture all possible data. This format is commonly used for partial token labeling projects. You can also use it when exporting token-based with arrow projects, such as coreference and dependency.

A JSON_ADVANCED file may contain the following data structures:

  1. layer: the layer position of the labels. This field is reserved for a project where a labeling of multiple tag set at once. For now you can disregard this field and this field is always set to 0.

  2. sidS, sidE: the sentence starting and ending position of a label in 0-based index. In Datasaur, it is possible that a label spans across sentences.

  3. s: the token starting position of a label in the starting sentence in 0-based index.

  4. e: the token ending position of a label in the ending sentence in 0-based index.

  5. charS: the character starting position of a label in the starting token in 0-based index.

  6. charE: the character ending position of a label in the ending token in 0-based index.

  7. l: the label applied.

  8. id: the unique identifier of a label.

    1. If the id has 9 segments, this indicates span label. For example, INNM0ViFwo8LluMTaTIK9:0:0:14:0:0:18:6:0 and here's the explanation <label set item id>:<layer>:<sidS>:<s>:<charS>:<sidE>:<e>:<charE>:<index>.

    2. If the id has 21 segments, this indicates arrow label. For example, tfc1FkbbEk9fOLx6haR1s:0:INNM0ViFwo8LluMTaTIK9:0:0:14:0:0:18:6:0:Oq_VuB0s_N7D8ZY0rgYsg:0:0:0:0:0:2:5:0:0 and here's the explanation <label set item id>:<arrow layer>:<….. origin id>:<….destination id>:<arrow index>.

  9. labelerInfo: the information about the labeler.

    1. id: the unique identifier of a labeler (each labeler has different id).

    2. email: email that labeler used when signing in.

    3. displayName: the display name of the email.

  10. labelSet: contains all the label items that you used for the project.

Example (token-based with arrow)

{
"sentences": [
{
"id": 0,
"content": "The Little Prince is a novella by French aristocrat , writer , and aviator Antoine de Saint - Exupéry .",
"tokens": [
"The",
"Little",
"Prince",
"is",
"a",
"novella",
"by",
"French",
"aristocrat",
",",
"writer",
",",
"and",
"aviator",
"Antoine",
"de",
"Saint",
"-",
"Exupéry",
"."
],
"labels": [
{
"layer": 0,
"sidS": 0,
"s": 0,
"charS": 0,
"sidE": 0,
"e": 2,
"charE": 5,
"l": "Oq_VuB0s_N7D8ZY0rgYsg",
"id": "Oq_VuB0s_N7D8ZY0rgYsg:0:0:0:0:0:2:5:0",
"deleted": false
},
{
"layer": 0,
"sidS": 0,
"s": 0,
"charS": 0,
"sidE": 0,
"e": 18,
"charE": 6,
"l": "tfc1FkbbEk9fOLx6haR1s",
"id": "tfc1FkbbEk9fOLx6haR1s:0:INNM0ViFwo8LluMTaTIK9:0:0:14:0:0:18:6:0:Oq_VuB0s_N7D8ZY0rgYsg:0:0:0:0:0:2:5:0:0",
"deleted": false
},
{
"layer": 0,
"sidS": 0,
"s": 14,
"charS": 0,
"sidE": 0,
"e": 18,
"charE": 6,
"l": "INNM0ViFwo8LluMTaTIK9",
"id": "INNM0ViFwo8LluMTaTIK9:0:0:14:0:0:18:6:0",
"deleted": false
}
]
}
],
"labelerInfo": {
"id": 212,
"email": "[email protected]",
"displayName": "Nadya Nurhafidzah"
},
"labelSet": {
"labelItems": [
{
"id": "dA3BJ2LsUM5vMyhHRE18Q",
"labelName": "Book"
},
{
"id": "Oq_VuB0s_N7D8ZY0rgYsg",
"labelName": "Novel"
},
{
"id": "pWtr8KhnEPxWFI8gwRGBw",
"labelName": "Poetry"
},
{
"id": "qsj6dOPwNG3d_Tum2Zvfr",
"labelName": "Biography"
},
{
"id": "n_6avpRLvvaIYFY23gkIG",
"labelName": "Character"
},
{
"id": "8eLxxSG7cZKw8PrL7YjMZ",
"labelName": "Antagonist"
},
{
"id": "Voo4F6z-jAGW8ZdPvM_3P",
"labelName": "Protagonist"
},
{
"id": "tfc1FkbbEk9fOLx6haR1s",
"labelName": "Author"
},
{
"id": "dT5y1PlbtW70294f7K82I",
"labelName": "Person"
},
{
"id": "H47PM3SZ0Ca25DUACNKD2",
"labelName": "Female"
},
{
"id": "INNM0ViFwo8LluMTaTIK9",
"labelName": "Male"
}
]
}
}

Example (token-based with character-based labeling)

{
"sentences": [
{
"id": 0,
"content": "Anna is building a little snowman in her yard.",
"tokens": [
"Anna",
"is",
"building",
"a",
"little",
"snowman",
"in",
"her",
"yard",
"."
],
"labels": [
{
"layer": 0,
"sidS": 0,
"s": 5,
"charS": 0,
"sidE": 0,
"e": 5,
"charE": 3,
"l": "ugNYFRP230BkwtKKnNWUw",
"id": "ugNYFRP230BkwtKKnNWUw:0:0:5:0:0:5:3:0",
"deleted": false
}
]
}
],
"labelSet": {
"labelItems": [
{
"id": "ugNYFRP230BkwtKKnNWUw",
"labelName": "NN"
}
]
}
}

MD (Markdown)

Markdown is a lightweight markup language with plain-text-formatting syntax, created in 2004 by John Gruber with Aaron Swartz. Markdown is often used to format readme files, for writing messages in online discussion forums, and to create rich text using a plain text editor.

Example

To all appearances The Little Prince is a children’s book. But ever
since its original publication in French in 1943, Antoine de
Saint-Exupéry’s story has enchanted audiences of all ages. The book’s
beloved hero is a small, blond-haired boy from asteroid B-612, which he
leaves to journey across the galaxy. Along his way, he visits a number
of planets each populated by a sole person with an absurd profession
(the little prince ultimately learns that there is no other kind). When
he lands on Earth, in the middle of the desert, he is met by a
mysterious snake. “Where are all the people?” the little prince asks.
“I’m beginning to feel lonely in this desert.” “You can feel lonely
among people, too,” replies the snake.
However elusive the story’s meaning, few have matched the universality
of its appeal. In April 2017, The Little Prince became the most
translated book in the world, excluding religious texts (which enjoyed
significant head starts). It now exists in 300 languages, a sum that
doesn’t even include the range of translations within languages. In
Korean, there are said to be about 50 different versions. Until
recently, English could claim only a meagre six. Now, Michael Morpurgo,
master storyteller and untested translator, has delivered a definitive
seventh.

SVG

Scalable Vector Graphics (SVG) is an Extensible Markup Language (XML)-based vector image format for two-dimensional graphics with support for interactivity and animation. SVG images and their behaviors are defined in XML text files. This means that they can be searched, indexed, scripted, and compressed. As XML files, SVG images can be created and edited with any text editor, as well as with drawing software.

BMP

A bitmap is a type of memory organization or image file format used to store digital images. The term bitmap comes from the computer programming terminology, meaning just a map of bits, a spatially mapped array of bits. Now, along with pixmap, it commonly refers to the similar concept of a spatially mapped array of pixels. Raster images in general may be referred to as bitmaps or pixmaps, whether synthetic or photographic, in files or memory.

TIFF and TIF

Tagged Image File Format, abbreviated TIFF or TIF, is a computer file format for storing raster graphics images, popular among graphic artists, the publishing industry, and photographers. TIFF is widely supported by scanning, faxing, word processing, optical character recognition, image manipulation, desktop publishing, and page-layout applications

WEBP

WebP is an image format employing both lossy and lossless compression. It is currently developed by Google, based on technology acquired with the purchase of On2 Technologies. As a derivative of the VP8 video format, it is a sister project to the WebM multimedia container format. WebP-related software is released under a BSD license.

JPEG and JPG

JPEG is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degree of compression can be adjusted, allowing a selectable trade off between storage size and image quality. JPEG typically achieves 10:1 compression with little perceptible loss in image quality.

PNG

Portable Network Graphics is a raster-graphics file format that supports lossless data compression. PNG was developed as an improved, non-patented replacement for Graphics Interchange Format (GIF). PNG supports palette-based images (with palettes of 24-bit RGB or 32-bit RGBA colors), grayscale images (with or without alpha channel for transparency), and full-color non-palette-based RGB or RGBA images. The PNG working group designed the format for transferring images on the Internet, not for professional-quality print graphics; therefore non-RGB color spaces such as CMYK are not supported

GIF

Graphics Interchange Format (GIF) is a bitmap image format. The format supports up to 8 bits per pixel for each image, allowing a single image to reference its own palette of up to 256 different colors chosen from the 24-bit RGB color space. It also supports animations and allows a separate palette of up to 256 colors for each frame. These palette limitations make GIF less suitable for reproducing color photographs and other images with color gradients, but well-suited for simpler images such as graphics or logos with solid areas of color. Unlike video, the GIF file format does not support audio.

PDF

The Portable Document Format (PDF) is a file format developed by Adobe in the 1990s to present documents, including text formatting and images, in a manner independent of application software, hardware, and operating systems. Based on the PostScript language, each PDF file encapsulates a complete description of a fixed-layout flat document, including the text, fonts, vector graphics, raster images and other information needed to display it. PDF was standardized as ISO 32000 in 2008, and no longer requires any royalties for its implementation.

PPTX

PPTX is a zipped, XML-based file format that is part of the Microsoft Office Open XML (also known as OOXML or OpenXML) specification, introduced as part of Microsoft Office 2007 and later. PPTX is the default presentation file format for new PowerPoint presentations. Support for loading and saving PPT files is built into PPTX.

DOCX

DOCX is part of Microsoft Office Open XML specification (also known as OOXML or OpenXML) and was introduced with Office 2007. DOCX is a zipped, XML-based file format. Microsoft Word 2007 and later uses DOCX as the default file format when creating a new document. Support for loading and saving legacy DOC files is also included.