Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hierarchical_topics: remove unused variable cluster_df significantly … #1701

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions bertopic/_bertopic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,8 +1004,6 @@ def hierarchical_topics(self,

# Find clustered documents
clusters = sch.fcluster(Z, t=Z[index][2], criterion='distance') - self._outliers
cluster_df = pd.DataFrame({"Topic": range(len(clusters)), "Cluster": clusters})
cluster_df = cluster_df.groupby("Cluster").agg({'Topic': lambda x: list(x)}).reset_index()
nr_clusters = len(clusters)

# Extract first topic we find to get the set of topics in a merged topic
Expand Down
Loading