diff --git a/bertopic/representation/_pos.py b/bertopic/representation/_pos.py index 3ac2815f..11d8e558 100644 --- a/bertopic/representation/_pos.py +++ b/bertopic/representation/_pos.py @@ -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)