AlGe commited on
Commit
f87218a
·
verified ·
1 Parent(s): 82ed97f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -163,7 +163,8 @@ def generate_wordcloud(entities: List[Dict], color_map: Dict[str, str]) -> np.nd
163
 
164
  for entity in entities:
165
  for token in entity['tokens']:
166
- cleaned_token = token.lstrip('_')
 
167
  token_texts.append(cleaned_token)
168
  token_scores.append(entity['score'])
169
  token_types.append(entity['entity'])
 
163
 
164
  for entity in entities:
165
  for token in entity['tokens']:
166
+ # Remove any leading non-alphanumeric characters
167
+ cleaned_token = re.sub(r'^\W+', '', token)
168
  token_texts.append(cleaned_token)
169
  token_scores.append(entity['score'])
170
  token_types.append(entity['entity'])