Skip to content

Commit 4826e4c

Browse files
authored
Merge pull request #126 from clamsproject/101-projects-subdirs
moved all annotation projects to a subdir, re-organized README files
2 parents d51eb64 + 8bc2404 commit 4826e4c

8,862 files changed

Lines changed: 191 additions & 191 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 109 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,125 @@
1-
# Repository-level Conventions
1+
# Contributing to AAPB-CLAMS Annotations
22

3-
Conventions on data formatting and precision, file names and data field names.
3+
This document provides guidelines for data managers and contributors who create and maintain annotation projects in this repository.
44

5+
## Project Directory Structure
56

6-
## Synopsis
7+
All annotation projects are located in the `projects/` directory. Each project lives in its own subdirectory under `projects/` (e.g., `projects/scene-recognition/`). The subdirectory name is the project name. A project directory must include:
8+
9+
- Raw annotation data (in dated batch directories)
10+
- Gold-formatted output files (in `golds/` directory)
11+
- Conversion scripts (typically `process.py`)
12+
- Project documentation (`README.md`)
13+
14+
### Raw Annotation Data
15+
16+
> [!IMPORTANT]
17+
> `YYMMDD-batchName` directory
18+
19+
This directory contains output files from the manual annotation process created by an annotation tool or by hand.
20+
21+
The raw annotation files are organized by batch name and starting date of the annotation. A single "period" of the annotation is the whole process of a single batch of source data (AAPB assets) being annotated. The `YYMMDD-` prefix _must_ indicate an associated time to a batch of annotation (usually that is when the batch is first prepared and used for annotation, or completed and delivered). The `batchName` part of the directory name _must_ match the basename of one of the `.txt` files in the [annotation batches directory](batches/README.md). The date and batch name prefixes are used for sorting annotation processes and machine ingestion of the raw data.
22+
23+
Different annotation tools create different file formats, hence we need conversion of the raw annotation files to files with a common format for the gold data.
24+
25+
26+
### Gold Dataset Files
27+
28+
> [!IMPORTANT]
29+
> `golds` directory
30+
31+
There are rules on the content and structure of the gold directory:
32+
33+
1. There _must_ be one file per GUID, and the GUID should be part of the filename.
34+
2. The number of gold files in this directory _must_ match the sum of GUIDs in all batches annotated. This means that there cannot be any overlap between assets in batches.
35+
3. The `golds` directory _may_ have subdirectories, but these subdirectories should not reflect batch structure, but rather different division of annotation type (e.g. pure named entity span annotation vs. named entity span + some grounding annotation) or format (same information but formatted as timepoints vs. time intervals).
36+
37+
38+
### Scripts for Format Conversion
39+
40+
> [!IMPORTANT]
41+
> _(usually)_ `process.{sh,py}`
42+
43+
This is typically a single script to process the raw annotation files and generate the gold data.
44+
The input file format (i.e., direct output from the annotation process) can vary (e.g. `.csv`, `.json`, `.txt`). The output file format must be a common machine-readable data format (CSV, TSV, JSON, but definitely not MMIF), and is **subject to change** for any future requirements in the consumption software.
45+
46+
In addition to the main script, if the code requires additional dependencies/scripts, they should be in the same level at that subdirectory. Dependencies on third-party modules can be documented in the `README.md` file or in a machine-friendly file with the list of dependencies (e.g. `requirements.txt` for `pip`).
47+
48+
Check the [Repository-level Conventions](#repository-level-conventions) section for naming conventions for common field/column names for gold data.
49+
50+
51+
### README File and Other Project Documentation
52+
53+
> [!IMPORTANT]
54+
> `README.md` (_and possibly `guidelines.{md,ppt}`_)
55+
56+
Project-specific information, including but not limited to:
57+
58+
* Annotation project name
59+
60+
* One-line summary of the project
61+
62+
* Annotator summary. Some basic demographic information about the annotators: age group, language proficiency, occupational characteristics, etc. No [personally identifiable information](https://en.wikipedia.org/wiki/Personal_data), unless the annotator wants to be credited.
63+
64+
* Annotation environment/tool information (name, version, link, user manual, etcetera). In most cases, there is a separate codebase (ideally on [https://github.com/clamsproject/](https://github.com/clamsproject/)) for the annotation tool which includes the manual.
65+
66+
* Project changes: version changes, selection of asset batches, change in annotator personnel, etc.
67+
68+
* Raw-to-gold conversion code explanation
69+
* dependencies, short description of `process.py`
70+
* formats of raw and gold files
71+
* field description, with data types
72+
* differences, added information, discarded information during `process.py`
73+
74+
* Annotation guidelines - sometimes as a separate file named `guidelines.{md,ppt}`. This section should give sufficient documentation for how the annotation was done and what the conditions/assumptions are under which the dataset exists:
75+
* What tool is used, and how it is used.
76+
* What to annotate
77+
* Options of label choices
78+
* Label formatting.
79+
* Differentiation between labels, edge cases, other decisions made during annotation.
80+
* Concerns, limitations, precision details. (e.g. time imprecision)
81+
82+
> [!NOTE]
83+
> `README.md` & `guidelines.{md,ppt}` files are supposed to be actively maintained by the project manager. All guideline files are recommended to be version-controlled.
84+
85+
86+
## Batch File Format
87+
88+
Each batch is defined by a `BATCH_NAME.txt` file in the `batches/` directory.
89+
90+
* Batches are often named after their relevant GitHub issue from the [AAPB-CLAMS collaboration repository](https://github.com/clamsproject/aapb-collaboration).
91+
92+
* Each line in the file must be either a single AAPB GUID or a comment starting with a `#`. The first lines are typically batch-level comments, while later comment lines may specify sources for subsequent AAPB GUIDs.
93+
94+
Typically, batch-level comments start and end with a comment line with just hyphens, for example:
95+
96+
```
97+
# --------------------------------------------------------------------------------
98+
# A set of videos that have various instances of "scenes with text" that are ideal
99+
# for creating labeled data for roles and fillers (key-value pairs) extraction.
100+
#
101+
# See https://github.com/clamsproject/aapb-annotations/issues/44 for the selection
102+
# process and other additional information.
103+
# --------------------------------------------------------------------------------
104+
```
105+
106+
107+
## Repository-level Conventions
7108

8109
> [!IMPORTANT]
9110
> Media Time = `hh:mm:ss.mmm` with a **DOT**
10111
> Annotation times are usually a little imprecise because audiovisual phenomena are, or visualizing/labelling of such is.
11112
> Some estimates of imprecision are given by Margin of Error.
12113
> Directionality definitions help frame the boundaries meant by annotated times.
13114
> The fields in the gold datasets should be standardized.
14-
> Naming conventions - batches: `repoName-issueNumber(-identifier).txt`
15-
16-
17-
## Data Formatting and Precision Conventions
18115
19116
### Field Naming Conventions
20117

21118
> [!NOTE]
22-
Also, often referred as "column names" (mainly because we tend to use tabular data formats like CSV, TSV, etc.).
119+
> Also often referred to as "column names" (mainly because we tend to use tabular data formats like CSV, TSV, etc.).
23120
24121
The field name in the "gold" data should indicate the type of data in the field.
25-
That is, fields that contains the same (or similar enough) data should have the same name across different annotation task subdirectories.
122+
That is, fields that contain the same (or similar enough) data should have the same name across different annotation task subdirectories.
26123
The following table provides a ledger for commonly used names and their data types (see [#117](https://github.com/clamsproject/aapb-annotations/issues/107) for discussion). Some names are **standardized** and must be used when applicable, while others are **common** conventions that are recommended for consistency.
27124

28125
| Field(s) Name | Description |
@@ -53,25 +150,15 @@ The time format for all (gold) datasets in this repository is [ISO 8601 Time For
53150

54151
> _TODO: Some gold datasets and tools have not yet been converted._
55152
56-
During raw annotation however, third-party annotation tools may use different time formats. The expectation for any in-house tools and apps is to use this standard. If configurable, annotations tool should be configured to use this format. If possible, the annotator should also be instructed to use this format.
153+
During raw annotation however, third-party annotation tools may use different time formats. The expectation for any in-house tools and apps is to use this standard. If configurable, annotation tools should be configured to use this format. If possible, the annotator should also be instructed to use this format.
57154

58155
> _TODO: the following prose is unclear_
59156
60157
Due to algorithmic differences in compression/decompression and their implementations in video players for human watchers, we may lose temporal precision. However, this is most likely to be in the order of a few milliseconds and hence not a significant problem.
61158

62-
<!--
63-
For MPEG-based video files, frame numbers are converted to milliseconds with loss of precision past 3-digits.
64-
However, due to exact time -> still-image-fetching being dependent on the video compression/codec/player, there is no expected need for precision past 3-digits.
65-
It is assumed that different video players will regenerate images on screen slightly differently based on the decompression algorithms.
66-
To that end, it is unlikely that even given a specific time moment that a person in one place would be able to extract exactly the same pixels
67-
in a frame as another person doing it somewhere else.
68-
The other reason frames was not chosen to divide seconds is that the collection also contains radio assets with audio only. Audio does not have frames.
69-
-->
70-
71-
72159
### Imprecision in Annotation in General
73160

74-
Currently, data Quality processes are currently still being designed and datasets do not have a data quality checklist applied to them. This means that general data messiness including typos are always possible.
161+
Currently, data quality processes are still being designed and datasets do not have a data quality checklist applied to them. This means that general data messiness including typos are always possible.
75162

76163
Two semi-preventative measures are:
77164

@@ -80,7 +167,6 @@ Two semi-preventative measures are:
80167

81168
The current convention is that annotators are asked to be as careful as possible, and some datasets are "quality-assumed" upon faith in annotators/environment until such time a quantitative analysis of errors is done.
82169

83-
84170
### Imprecision in Time-based Annotation
85171

86172
Time-based annotations are almost inherently imprecise. This is due usually to either perception or manipulation of the tool within the limits of meaningful task-speed constraints. Furthermore, the features of audiovisual materials do not always have clear-cut beginning and end points.
@@ -114,8 +200,7 @@ i.e. Any time given by the annotated time interval of the chyron should return a
114200

115201
Finally, a reminder that at 30 frames per second, each frame is 0.033_ seconds long - meaning a tenth of a second has 3 frames within it. Practically speaking, there is only a small percentage of cases where the variation between one frame to its neighbor is relevant, especially in cases of human perception. The conventions for precision hold until new needs of the project are required.
116202

117-
118-
## File Naming Conventions
203+
### Batch File Naming Conventions
119204

120205
Batch names should be in lower case. If a batch is named after a GitHub issue it should be in this format:
121206

0 commit comments

Comments
 (0)