Skip to content

Commit

Permalink
Fix regex matching being used in PartOfSpeech representation model (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
woranov authored Sep 17, 2024
1 parent 0b4265a commit eba1d34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bertopic/representation/_pos.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def extract_topics(
candidate_documents = []
for keyword in keywords:
selection = documents.loc[documents.Topic == topic, :]
selection = selection.loc[selection.Document.str.contains(keyword), "Document"]
selection = selection.loc[selection.Document.str.contains(keyword, regex=False), "Document"]
if len(selection) > 0:
for document in selection[:2]:
candidate_documents.append(document)
Expand Down

0 comments on commit eba1d34

Please sign in to comment.