imvladikon commited on
Commit
e146819
1 Parent(s): 986013a

Update bmc.py

Browse files
Files changed (1) hide show
  1. bmc.py +5 -0
bmc.py CHANGED
@@ -60,6 +60,7 @@ class BMC(datasets.GeneratorBasedBuilder):
60
  {
61
  "id": datasets.Value("string"),
62
  "tokens": datasets.Sequence(datasets.Value("string")),
 
63
  "ner_tags": datasets.Sequence(
64
  datasets.features.ClassLabel(
65
  names=[
@@ -124,6 +125,7 @@ class BMC(datasets.GeneratorBasedBuilder):
124
  guid = 0
125
  tokens = []
126
  ner_tags = []
 
127
  for line in f:
128
  if line.startswith("-DOCSTART-") or line == "" or line == "\n":
129
  if tokens:
@@ -134,14 +136,17 @@ class BMC(datasets.GeneratorBasedBuilder):
134
  }
135
  guid += 1
136
  tokens = []
 
137
  ner_tags = []
138
  else:
139
  splits = line.split(sep)
140
  tokens.append(splits[0])
 
141
  ner_tags.append(splits[1].rstrip())
142
  # last example
143
  yield guid, {
144
  "id": str(guid),
145
  "tokens": tokens,
 
146
  "ner_tags": ner_tags,
147
  }
 
60
  {
61
  "id": datasets.Value("string"),
62
  "tokens": datasets.Sequence(datasets.Value("string")),
63
+ "raw_tags": datasets.Sequence(datasets.Value("string")),
64
  "ner_tags": datasets.Sequence(
65
  datasets.features.ClassLabel(
66
  names=[
 
125
  guid = 0
126
  tokens = []
127
  ner_tags = []
128
+ raw_tags = []
129
  for line in f:
130
  if line.startswith("-DOCSTART-") or line == "" or line == "\n":
131
  if tokens:
 
136
  }
137
  guid += 1
138
  tokens = []
139
+ raw_tags = []
140
  ner_tags = []
141
  else:
142
  splits = line.split(sep)
143
  tokens.append(splits[0])
144
+ raw_tags.append(splits[1].rstrip())
145
  ner_tags.append(splits[1].rstrip())
146
  # last example
147
  yield guid, {
148
  "id": str(guid),
149
  "tokens": tokens,
150
+ "raw_tags": raw_tags,
151
  "ner_tags": ner_tags,
152
  }