Skip to content

Commit 2f5c81b

Browse files
committed
Sentence grouping on NER replace
1 parent 93ce9f6 commit 2f5c81b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

plasticity/sapien/core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,16 @@ def ner_replace(self):
246246
ner = self.ner()
247247
data_out = []
248248
for sg_data, sg_ner in zip(self.data, ner):
249+
sentence_group_out = []
249250
for alt_data, alt_ner in zip(sg_data.alternatives, sg_ner):
250251
# Replace the text in the sentence with the named entities
251252
new_sentence = alt_data.sentence
252253
for graph in alt_ner:
253254
for entity in graph:
254255
new_sentence = new_sentence.replace(
255256
entity['entity'], entity['ner'][0]['label'])
256-
data_out.append(new_sentence)
257+
sentence_group_out.append(new_sentence)
258+
data_out.append(sentence_group_out)
257259
return data_out
258260

259261

plasticity/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version_info__ = ('0', '0', '5')
1+
__version_info__ = ('0', '0', '6')
22
__version__ = '.'.join(__version_info__)

0 commit comments

Comments
 (0)