You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Bulk Labeling for Text Spans with Keyboard Shortcut
3
+
short: Bulk Labeling for Text Spans
3
4
type: plugins
4
5
category: Automation
5
6
cat: automation
@@ -18,68 +19,143 @@ tier: enterprise
18
19
19
20
## About
20
21
21
-
This plugin automatically applies the same label to all matching text spans.
22
+
This plugin automatically applies the same label to all matching text spans when you press the **Shift** key.
22
23
23
24
For example, if you apply the `PER` label to the text span `Smith`, this plugin will automatically find all instances of `Smith` in the text and apply the `PER` label to them.
24
25
25
-

26
+

27
+
28
+
1.**Shift key tracking**
29
+
- The plugin tracks the state of the Shift key using `keydown` and `keyup` event listeners. A boolean variable `isShiftKeyPressed` is set to `true` when the Shift key is pressed and `false` when it is released.
30
+
2.**Bulk deletion**
31
+
- When a region (annotation) is deleted and the Shift key is pressed, the plugin identifies all regions with the same text and label as the deleted region.
32
+
- It then deletes all these matching regions to facilitate bulk deletion.
33
+
3.**Bulk creation**
34
+
- When a region is created and the Shift key is pressed, the plugin searches for all occurrences of the created region's text within the document.
35
+
- It creates new regions for each occurrence of the text, ensuring that no duplicate regions are created (i.e., regions with overlapping start and end offsets are avoided).
36
+
- The plugin also prevents tagging of single characters to avoid unnecessary annotations.
37
+
4.**Timeout**
38
+
- To prevent rapid consecutive bulk operations, the plugin sets a timeout of 1 second. This ensures that bulk operations are not triggered too frequently.
26
39
27
40
## Plugin
28
41
29
42
```javascript
30
43
/**
31
-
* Automatically creates all the text regions containing all instances of the selected text.
44
+
* Automatically creates text regions for all instances of the selected text and deletes existing regions
45
+
* when the shift key is pressed.
32
46
*/
33
47
34
-
// It will be triggered when a text selection happens
Each video is wrapped in a `<View>` tag with a width of 100% to ensure they stack on top of each other. The `Header` tag provides a title for
115
+
each video, indicating which frame is being displayed.
116
+
117
+
The `Video` tags are used to load the video content, with the `name` attribute uniquely identifying each video player.
118
+
119
+
The `TimelineLabels` tag is connected to the second video (`video0`), allowing annotators to label specific segments of that video. The labels `class1` and `class2` can be used to categorize the content of the video, enhancing the annotation process.
0 commit comments