Pclanglais commited on
Commit
1cf35d9
1 Parent(s): fac8734

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -6
app.py CHANGED
@@ -97,13 +97,8 @@ def transform_chunks(marianne_segmentation):
97
 
98
  # Add entity_group as a header to each word
99
  marianne_segmentation['word'] = '### ' + marianne_segmentation['entity_group'] + ' ###\n' + marianne_segmentation['word']
100
-
101
- # Group by text_id, identifier, and date, then concatenate words
102
- marianne_segmentation = marianne_segmentation.agg({
103
- 'word': lambda x: '\n\n'.join(x.dropna())
104
- }).reset_index()
105
 
106
- final_text = marianne_segmentation['word'].tolist()[0]
107
 
108
  return final_text
109
 
 
97
 
98
  # Add entity_group as a header to each word
99
  marianne_segmentation['word'] = '### ' + marianne_segmentation['entity_group'] + ' ###\n' + marianne_segmentation['word']
 
 
 
 
 
100
 
101
+ final_text = '\n\n'.join(marianne_segmentation['word'].tolist())
102
 
103
  return final_text
104