Hellisotherpeople commited on
Commit
02b1aaf
1 Parent(s): c0985b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -126,15 +126,16 @@ if task == "Clustering":
126
  @st.cache
127
  def fit_text_clf(X, y):
128
  text_clf.fit(X, y)
 
129
 
130
  if task == "Classification":
131
  #text_clf.fit(df[column_name], df[labels_column_name])
132
- fit_text_clf(df[column_name], df[labels_column_name])
133
  else:
134
  kmeans = cluster_clf.fit(df[column_name])
135
  labels = list(cluster_clf['cluster'].labels_)
136
  #text_clf.fit(df[column_name], labels)
137
- fit_text_clf(df[column_name], labels)
138
  st.write("Generated Clusters for each example")
139
  st.write(labels)
140
 
 
126
  @st.cache
127
  def fit_text_clf(X, y):
128
  text_clf.fit(X, y)
129
+ return text_clf
130
 
131
  if task == "Classification":
132
  #text_clf.fit(df[column_name], df[labels_column_name])
133
+ text_clf = fit_text_clf(df[column_name], df[labels_column_name])
134
  else:
135
  kmeans = cluster_clf.fit(df[column_name])
136
  labels = list(cluster_clf['cluster'].labels_)
137
  #text_clf.fit(df[column_name], labels)
138
+ text_clf = fit_text_clf(df[column_name], labels)
139
  st.write("Generated Clusters for each example")
140
  st.write(labels)
141