Spaces:
Runtime error
Runtime error
Update text_annotatator.py
Browse files- text_annotatator.py +17 -16
text_annotatator.py
CHANGED
@@ -1,22 +1,23 @@
|
|
1 |
def get_display_only_data():
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
16 |
|
17 |
def get_editable_data():
|
18 |
|
19 |
-
|
20 |
"allowEditing": True,
|
21 |
"tokens": [
|
22 |
{"text": "He", "labels": ["Pronoun", "Person"]},
|
@@ -46,4 +47,4 @@ def get_editable_data():
|
|
46 |
{"text": "Animal"},
|
47 |
]
|
48 |
}
|
49 |
-
|
|
|
1 |
def get_display_only_data():
|
2 |
+
data1 = {
|
3 |
+
"tokens": [
|
4 |
+
{"text": "He", "labels": ["Person"]},
|
5 |
+
{"text": "loves"},
|
6 |
+
{"text": "his"},
|
7 |
+
{"text": "dog", "labels": ["Animal", "Pet"]},
|
8 |
+
],
|
9 |
+
"labels": [
|
10 |
+
{"text": "Person"},
|
11 |
+
{"text": "Action"},
|
12 |
+
{"text": "Animal"},
|
13 |
+
]
|
14 |
+
}
|
15 |
+
|
16 |
+
return data1
|
17 |
|
18 |
def get_editable_data():
|
19 |
|
20 |
+
data2 = {
|
21 |
"allowEditing": True,
|
22 |
"tokens": [
|
23 |
{"text": "He", "labels": ["Pronoun", "Person"]},
|
|
|
47 |
{"text": "Animal"},
|
48 |
]
|
49 |
}
|
50 |
+
return data 2
|