qanastek commited on
Commit
1e1ce7c
·
1 Parent(s): 5aa19ef

Update E3C.py

Browse files
Files changed (1) hide show
  1. E3C.py +14 -26
E3C.py CHANGED
@@ -54,34 +54,22 @@ class E3C(datasets.GeneratorBasedBuilder):
54
  self.config.name = self.DEFAULT_CONFIG_NAME
55
 
56
  if self.config.name.find("clinical") != -1:
57
-
58
- features = datasets.Features(
59
- {
60
- "id": datasets.Value("string"),
61
- "text": datasets.Value("string"),
62
- "tokens": datasets.Sequence(datasets.Value("string")),
63
- "ner_clinical_tags": datasets.Sequence(
64
- datasets.features.ClassLabel(
65
- names=["O","B-CLINENTITY","I-CLINENTITY"],
66
- ),
67
- ),
68
- }
69
- )
70
-
71
  elif self.config.name.find("temporal") != -1:
72
-
73
- features = datasets.Features(
74
- {
75
- "id": datasets.Value("string"),
76
- "text": datasets.Value("string"),
77
- "tokens": datasets.Sequence(datasets.Value("string")),
78
- "ner_temporal_tags": datasets.Sequence(
79
- datasets.features.ClassLabel(
80
- names=["O", "B-EVENT", "B-ACTOR", "B-BODYPART", "B-TIMEX3", "B-RML", "I-EVENT", "I-ACTOR", "I-BODYPART", "I-TIMEX3", "I-RML"],
81
- ),
82
  ),
83
- }
84
- )
 
85
 
86
  print(features)
87
 
 
54
  self.config.name = self.DEFAULT_CONFIG_NAME
55
 
56
  if self.config.name.find("clinical") != -1:
57
+ names=["O","B-CLINENTITY","I-CLINENTITY"]
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  elif self.config.name.find("temporal") != -1:
59
+ names = ["O", "B-EVENT", "B-ACTOR", "B-BODYPART", "B-TIMEX3", "B-RML", "I-EVENT", "I-ACTOR", "I-BODYPART", "I-TIMEX3", "I-RML"]
60
+
61
+ features = datasets.Features(
62
+ {
63
+ "id": datasets.Value("string"),
64
+ "text": datasets.Value("string"),
65
+ "tokens": datasets.Sequence(datasets.Value("string")),
66
+ "ner_tags": datasets.Sequence(
67
+ datasets.features.ClassLabel(
68
+ names=names,
69
  ),
70
+ ),
71
+ }
72
+ )
73
 
74
  print(features)
75