Skip to content

Commit

Permalink
Merging custom word list with spacy_lemma column
Browse files Browse the repository at this point in the history
  • Loading branch information
ThijsVroegh committed Oct 15, 2024
1 parent 8ebb98b commit 01eaea0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions orangecontrib/storynavigation/modules/tagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ def __process_stories(self, nlp, text_tuples, callback):
if self.custom_tags is not None and self.word_column is not None:
collection_df['custom_' + self.word_column] = collection_df['token_text'].str.lower()
collection_df['custom_' + self.word_column] = collection_df['custom_' + self.word_column].str.lstrip('0123456789@#$!“"-')
collection_df = pd.merge(collection_df, self.custom_tags, left_on='custom_' + self.word_column, right_on=self.word_column, how='left')
collection_df = collection_df.drop(columns=[self.word_column])

if self.use_infinitives:
collection_df = pd.merge(collection_df, self.custom_tags, left_on='custom_' + self.word_column, right_on=self.word_column, how='left')
collection_df = collection_df.drop(columns=[self.word_column])
else:
collection_df['token_text_lowercase'] = collection_df['token_text'].str.lower()

Expand Down

0 comments on commit 01eaea0

Please sign in to comment.